Commit 897be69c authored by hongguangwu's avatar hongguangwu

MVP1.7.1 预入职更新在项时的薪资人员

parent b9743422
......@@ -194,9 +194,9 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tSalaryEmployee = sdr.getData();
}
TPreEmpMain main = baseMapper.getTPreEmpMainByCardAndDept(empIdCard, deptId);
TEmployeeInfo employee = null;
TEmployeeInfo employee = tEmployeeInfoService.getInfoByIdcard(empIdCard);
String empId = null;
TEmployeeProject project;
TEmployeeProject project = tEmployeeProjectService.getByEmpIdCardAndDeptId(empIdCard, deptId);
PreEmpMainDetailVo vo = new PreEmpMainDetailVo();
YifuUser user = getNewYifuUser();
if (main != null && CommonConstants.FIVE_STRING.equals(main.getStatus())) {
......@@ -229,9 +229,25 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TPreEmployeeInfo tPreEmployeeInfo = tPreEmployeeInfoService.getTPreEmployeeInfoList(main.getId());
if (tPreEmployeeInfo != null && Common.isNotNull(tPreEmployeeInfo.getId())) {
empId = tPreEmployeeInfo.getId();
// 预入职已审核+在项,取在项信息
if (CommonConstants.FOUR_STRING.equals(main.getStatus()) && employee != null && project != null) {
empId = employee.getId();
BeanUtil.copyProperties(employee, tPreEmployeeInfo, ID);
tPreEmployeeInfo.setOldId(employee.getId());
}
if (employee == null) {
tPreEmployeeInfo.setOldId(null);
}
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
} else {
tPreEmployeeInfo = new TPreEmployeeInfo();
// 预入职已审核+在项,取在项信息
if (CommonConstants.FOUR_STRING.equals(main.getStatus()) && employee != null && project != null) {
empId = employee.getId();
BeanUtil.copyProperties(employee, tPreEmployeeInfo, ID);
tPreEmployeeInfo.setOldId(employee.getId());
}
tPreEmployeeInfo.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeInfo.setEmpName(main.getEmpName());
tPreEmployeeInfo.setPreMainId(main.getId());
......@@ -244,11 +260,24 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TPreEmployeeProject tPreEmployeeProject = tPreEmployeeProjectService.getTPreEmployeeProjectList(main.getId());
// 预入职-项目档案表
if (tPreEmployeeProject != null) {
// 预入职已审核+在项,取在项信息
if (CommonConstants.FOUR_STRING.equals(main.getStatus()) && employee != null && project != null) {
BeanUtil.copyProperties(project, tPreEmployeeProject, ID);
tPreEmployeeProject.setOldId(project.getId());
}
if (project == null) {
tPreEmployeeProject.setOldId(null);
}
vo.setTpreEmployeeProject(tPreEmployeeProject);
} else {
tPreEmployeeProject = new TPreEmployeeProject();
tPreEmployeeProject.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeProject.setEmpName(main.getEmpName());
// 预入职已审核+在项,取在项信息
if (CommonConstants.FOUR_STRING.equals(main.getStatus()) && employee != null && project != null) {
BeanUtil.copyProperties(project, tPreEmployeeProject, ID);
tPreEmployeeProject.setOldId(project.getId());
}
tPreEmployeeProject.setUnitId(dept.getCustomerId());
tPreEmployeeProject.setUnitName(dept.getCustomerName());
tPreEmployeeProject.setUnitNo(dept.getCustomerNo());
......@@ -288,8 +317,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
vo.setTpreEmpDeclaration(tPreEmpDeclaration);
main.setDeclarationId(tPreEmpDeclaration.getId());
this.save(main);
// 查询档案信息
employee = tEmployeeInfoService.getInfoByIdcard(empIdCard);
TPreEmployeeInfo tPreEmployeeInfo;
TPreEmployeeProject tPreEmployeeProject;
if (employee != null) {
......@@ -303,7 +331,7 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmployeeInfo.setCreateTime(LocalDateTime.now());
tPreEmployeeInfoService.saveOrUpdate(tPreEmployeeInfo);
vo.setTpreEmployeeInfo(tPreEmployeeInfo);
project = tEmployeeProjectService.getByEmpIdCardAndDeptId(empIdCard, deptId);
if (project != null) {
tPreEmployeeProject = new TPreEmployeeProject();
BeanUtil.copyProperties(project, tPreEmployeeProject, ID);
......@@ -551,6 +579,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
tPreEmployeeInfo = tPreEmployeeInfoService.getTPreEmployeeInfoList(id);
if (tPreEmployeeInfo == null) {
tPreEmployeeInfo = new TPreEmployeeInfo();
// 预入职已审核+在项,取在项信息
if (CommonConstants.FOUR_STRING.equals(main.getStatus()) && employee != null && project != null) {
BeanUtil.copyProperties(employee, tPreEmployeeInfo, ID);
tPreEmployeeInfo.setOldId(project.getId());
}
tPreEmployeeInfo.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeInfo.setPreMainId(main.getId());
tPreEmployeeInfo.setCreateBy(user.getId());
......@@ -575,6 +608,11 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
TPreEmployeeProject tPreEmployeeProject = tPreEmployeeProjectService.getTPreEmployeeProjectList(id);
if (tPreEmployeeProject == null) {
tPreEmployeeProject = new TPreEmployeeProject();
// 预入职已审核+在项,取在项信息
if (CommonConstants.FOUR_STRING.equals(main.getStatus()) && employee != null && project != null) {
BeanUtil.copyProperties(project, tPreEmployeeProject, ID);
tPreEmployeeProject.setOldId(project.getId());
}
tPreEmployeeProject.setEmpIdcard(main.getEmpIdcard());
tPreEmployeeProject.setUnitId(dept.getCustomerId());
tPreEmployeeProject.setUnitName(dept.getCustomerName());
......
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