Commit a36de4f8 authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

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