Commit d1104dad authored by 刘斌's avatar 刘斌

feat: 增加家庭成员5

parent a55e0959
......@@ -3,6 +3,7 @@ package com.anplus.hr.controller;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.cola.dto.Response;
import com.anplus.hr.domain.params.EmployeeBaseInfoParam;
import com.anplus.hr.domain.params.EmployeeInfoParam;
import com.anplus.hr.service.EmployeeInfoServ;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -10,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.binfast.common.core.constant.BusinessType;
import top.binfast.common.core.enums.ResultCode;
import top.binfast.common.core.util.ResponseUtils;
import top.binfast.common.idempotent.annotation.NoRepeatSubmit;
import top.binfast.common.log.annotation.PinSysLog;
......@@ -35,6 +37,11 @@ public class EmployeeBaseInfoForH5Ctrl {
@PinSysLog(value = "基础员工信息", businessType = BusinessType.INSERT)
@PostMapping()
public Response addBaseInfo(@RequestBody EmployeeBaseInfoParam param) {
EmployeeInfoParam employeeInfoParam = new EmployeeInfoParam();
employeeInfoParam.setIdCardNumber(param.getIdCardNumber());
if (employeeInfoServ.checkEmployeeIdCardNumberUnique(employeeInfoParam)) {
return Response.buildFailure(ResultCode.FAIL.getCode(), "员工身份证号已存在");
}
return ResponseUtils.ofResult(employeeInfoServ.insertBaseInfoForH5(param));
}
}
......@@ -27,6 +27,7 @@ import top.binfast.app.biz.sysapi.bean.vo.sysDept.SysDeptDTO;
import top.binfast.app.biz.sysapi.bean.vo.sysOss.SysOssVo;
import top.binfast.common.core.constant.BusinessType;
import top.binfast.common.core.enums.ResultCode;
import top.binfast.common.core.exception.PlatformException;
import top.binfast.common.core.util.ResponseUtils;
import top.binfast.common.core.validate.AddGroup;
import top.binfast.common.core.validate.EditGroup;
......@@ -143,6 +144,9 @@ public class EmployeeInfoCtrl {
@PinSysLog(value = "员工信息", businessType = BusinessType.INSERT)
@PostMapping()
public Response add(@Validated(AddGroup.class) @RequestBody EmployeeInfoParam param) {
if (employeeInfoServ.checkEmployeeIdCardNumberUnique(param)) {
return Response.buildFailure(ResultCode.FAIL.getCode(), "员工身份证号已存在");
}
return ResponseUtils.ofResult(employeeInfoServ.insertByParam(param));
}
......@@ -154,6 +158,9 @@ public class EmployeeInfoCtrl {
@PinSysLog(value = "员工信息", businessType = BusinessType.UPDATE)
@PutMapping()
public Response edit(@Validated(EditGroup.class) @RequestBody EmployeeInfoParam param) {
if (employeeInfoServ.checkEmployeeIdCardNumberUnique(param)) {
return Response.buildFailure(ResultCode.FAIL.getCode(), "员工身份证号已存在");
}
return ResponseUtils.ofResult(employeeInfoServ.updateByParam(param));
}
......
......@@ -489,7 +489,7 @@ public class EmployeeInfoServImpl extends ServiceImpl<EmployeeInfoMapper, Employ
familyMembersCmdExe.updateEmergencyInfo(param.getFamilyMembers(), employeeInfo);
boolean flag = this.updateById(employeeInfo);
if (flag) {
familyMembersCmdExe.updateByEmployee(param.getFamilyMembers(), employeeInfo);
familyMembersCmdExe.insertByEmployee(param.getFamilyMembers(), employeeInfo);
}
return flag;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment