Commit a36de4f8 authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent 5645ad17
......@@ -147,6 +147,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
.eq(TEmployeeInfo::getEmpIdcard, tEmployeeProject.getEmpIdcard())
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL));
if (Common.isNotNull(tEmployeeInfo)) {
String empNO = getEmpNo(tEmployeeProject.getDeptNo());
tEmployeeProject.setEmpNo(empNO);
tEmployeeProject.setEmpId(tEmployeeInfo.getId());
this.save(tEmployeeProject);
return R.ok();
......@@ -519,14 +521,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
//人员档案主表id先设置成空,后面更新id
insTEmployeePro.setEmpId(CommonConstants.EMPTY_STRING);
String str = "";
String EmpNo = baseMapper.findEmployeeMaxOnlyNoByDepId(insTEmployeePro.getDeptNo());
if (!Common.isEmpty(EmpNo)) {
str = NoUtil.productionNo(EmpNo, CommonConstants.EMPLOYEE_INIT_NO_START);
} else {
str = insTEmployeePro.getDeptNo() + CommonConstants.EMPLOYEE_INIT_NO;
}
insTEmployeePro.setEmpNo(str);
String empNO = getEmpNo(insTEmployeePro.getDeptNo());
insTEmployeePro.setEmpNo(empNO);
//员工编码生成规则
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, excel.getEmpIdcard())
......@@ -687,14 +683,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject.setEmpName(employeeInfo.getEmpName());
tEmployeeProject.setEmpIdcard(employeeInfo.getEmpIdcard());
tEmployeeProject.setPost(employeeInfo.getPost());
String str = "";
String EmpNo = baseMapper.findEmployeeMaxOnlyNoByDepId(employeeInfo.getDeptNo());
if (!Common.isEmpty(EmpNo)) {
str = NoUtil.productionNo(EmpNo, CommonConstants.EMPLOYEE_INIT_NO_START);
} else {
str = employeeInfo.getDeptNo() + CommonConstants.EMPLOYEE_INIT_NO;
}
tEmployeeProject.setEmpNo(str);
String empNO = getEmpNo(employeeInfo.getDeptNo());
tEmployeeProject.setEmpNo(empNO);
tEmployeeProject.setDeptNo(employeeInfo.getDeptNo());
TSettleDomain tSettleDomain = tSettleDomainService.getOne(Wrappers.<TSettleDomain>query().lambda()
......@@ -810,4 +801,15 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return R.ok(projectMap);
}
//获取员工编码
public String getEmpNo(String deptNo) {
String str = "";
String EmpNo = baseMapper.findEmployeeMaxOnlyNoByDepId(deptNo);
if (!Common.isEmpty(EmpNo)) {
str = NoUtil.productionNo(EmpNo, CommonConstants.EMPLOYEE_INIT_NO_START);
} else {
str = deptNo + CommonConstants.EMPLOYEE_INIT_NO;
}
return str;
}
}
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