Commit 3903a1d8 authored by hongguangwu's avatar hongguangwu

MVP1.7.7-CSP入离职的日志+处理

parent 13cfabad
...@@ -253,6 +253,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -253,6 +253,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject.setProjectSource(CommonConstants.dingleDigitStrArray[5]); tEmployeeProject.setProjectSource(CommonConstants.dingleDigitStrArray[5]);
this.save(tEmployeeProject); this.save(tEmployeeProject);
// 新增,同步CSP
this.doSaveBelongDept(tEmployeeProject, CommonConstants.ONE_STRING);
if (CommonConstants.ZERO_STRING.equals(tEmployeeProject.getEmpNatrue())) { if (CommonConstants.ZERO_STRING.equals(tEmployeeProject.getEmpNatrue())) {
tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING); tEmployeeInfo.setEmpNatrue(CommonConstants.ZERO_STRING);
} else if (CommonConstants.ONE_STRING.equals(tEmployeeProject.getEmpNatrue()) && } else if (CommonConstants.ONE_STRING.equals(tEmployeeProject.getEmpNatrue()) &&
...@@ -342,6 +345,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -342,6 +345,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject.setDeleteFlag(CommonConstants.ONE_STRING); tEmployeeProject.setDeleteFlag(CommonConstants.ONE_STRING);
baseMapper.updateById(tEmployeeProject); baseMapper.updateById(tEmployeeProject);
// 减少,同步CSP
YifuUser user = SecurityUtils.getUser();
tEmployeeProject.setLeaveTime(LocalDateTime.now());
tEmployeeProject.setLeaveUser(user.getNickname());
this.doSaveBelongDept(tEmployeeProject, CommonConstants.TWO_STRING);
//更新操作记录 //更新操作记录
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "",
tEmployeeProject.getId(), compareProject, tEmployeeProject); tEmployeeProject.getId(), compareProject, tEmployeeProject);
...@@ -354,7 +363,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -354,7 +363,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (Common.isNotNull(tEmployeeInfo)) { if (Common.isNotNull(tEmployeeInfo)) {
updList.add(tEmployeeInfo); updList.add(tEmployeeInfo);
YifuUser user = SecurityUtils.getUser();
doJointTask.doUpdateEmployeeInfo(updList, user); doJointTask.doUpdateEmployeeInfo(updList, user);
} }
return R.ok(); return R.ok();
...@@ -383,6 +391,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -383,6 +391,9 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[0]); tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[0]);
this.updateById(tEmployeeProject); this.updateById(tEmployeeProject);
// 增加,同步CSP
this.doSaveBelongDept(tEmployeeProject, CommonConstants.ONE_STRING);
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda() TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, tEmployeeProject.getEmpIdcard()) .eq(TEmployeeInfo::getEmpIdcard, tEmployeeProject.getEmpIdcard())
.eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL) .eq(TEmployeeInfo::getDeleteFlag, CommonConstants.STATUS_NORMAL)
...@@ -423,6 +434,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -423,6 +434,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
TEmployeeProject tEmployeeProject = this.getById(empProId); TEmployeeProject tEmployeeProject = this.getById(empProId);
tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[0]); tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[0]);
this.updateById(tEmployeeProject); this.updateById(tEmployeeProject);
// 增加,同步CSP
this.doSaveBelongDept(tEmployeeProject, CommonConstants.ONE_STRING);
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1],
"", empProId, tEmployeeProjectOld, tEmployeeProject); "", empProId, tEmployeeProjectOld, tEmployeeProject);
...@@ -494,9 +509,15 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -494,9 +509,15 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
return R.failed(errorTemp.substring(0,errorTemp.length()-1) +",禁止减项"); return R.failed(errorTemp.substring(0,errorTemp.length()-1) +",禁止减项");
} }
tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[1]); tEmployeeProject.setProjectStatus(CommonConstants.dingleDigitIntArray[1]);
YifuUser user = SecurityUtils.getUser();
tEmployeeProject.setLeaveUser(user.getNickname());
tEmployeeProject.setLeaveTime(LocalDateTime.now()); tEmployeeProject.setLeaveTime(LocalDateTime.now());
this.updateById(tEmployeeProject); this.updateById(tEmployeeProject);
// 减少,同步CSP
this.doSaveBelongDept(tEmployeeProject, CommonConstants.TWO_STRING);
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId()); TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
//查询该人员其他的项目档案 //查询该人员其他的项目档案
...@@ -516,7 +537,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -516,7 +537,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark()); tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
} }
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime()); tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
YifuUser user = SecurityUtils.getUser();
tEmployeeInfo.setLeaveUser(user.getId()); tEmployeeInfo.setLeaveUser(user.getId());
tEmployeeInfo.setLeaveUserName(user.getNickname()); tEmployeeInfo.setLeaveUserName(user.getNickname());
code = CommonConstants.ONE_STRING; code = CommonConstants.ONE_STRING;
...@@ -637,6 +657,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -637,6 +657,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
long contractCount; long contractCount;
StringBuilder errorTemp; StringBuilder errorTemp;
StringBuilder errorMessage; StringBuilder errorMessage;
YifuUser user = SecurityUtils.getUser();
// 执行数据插入操作 组装 PostDto // 执行数据插入操作 组装 PostDto
for (EmployeeXProjectVO excel : excelVOList) { for (EmployeeXProjectVO excel : excelVOList) {
//根据身份证和项目编码获取项目档案 //根据身份证和项目编码获取项目档案
...@@ -702,6 +723,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -702,6 +723,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject.setLeaveReason(excel.getLeaveReason()); tEmployeeProject.setLeaveReason(excel.getLeaveReason());
tEmployeeProject.setLeaveRemark(excel.getLeaveRemark()); tEmployeeProject.setLeaveRemark(excel.getLeaveRemark());
tEmployeeProject.setLeaveTime(LocalDateTime.now()); tEmployeeProject.setLeaveTime(LocalDateTime.now());
tEmployeeProject.setLeaveUser(user.getNickname());
updProjectList.add(tEmployeeProject); updProjectList.add(tEmployeeProject);
newOldProject = new EmployeeProjectNewOldVO(); newOldProject = new EmployeeProjectNewOldVO();
...@@ -720,11 +742,16 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -720,11 +742,16 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (!errorMessageList.isEmpty()) { if (!errorMessageList.isEmpty()) {
return R.failed(errorMessageList); return R.failed(errorMessageList);
} else { } else {
YifuUser user = SecurityUtils.getUser();
//更新项目档案 //更新项目档案
if (!updProjectList.isEmpty()) { if (!updProjectList.isEmpty()) {
baseMapper.updateReduceEmpProject(updProjectList); baseMapper.updateReduceEmpProject(updProjectList);
for (TEmployeeProject reduceProject : updProjectList) {
// 减少,同步CSP
this.doSaveBelongDept(reduceProject, CommonConstants.TWO_STRING);
}
} }
//更新人员档案 //更新人员档案
if (!updList.isEmpty()) { if (!updList.isEmpty()) {
List<TEmployeeInfo> updEmpInfoList = updList.stream().distinct().collect(Collectors.toList()); List<TEmployeeInfo> updEmpInfoList = updList.stream().distinct().collect(Collectors.toList());
...@@ -936,6 +963,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -936,6 +963,10 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
} }
if (!proInsList.isEmpty()) { if (!proInsList.isEmpty()) {
baseMapper.insertExcelEmpProject(proInsList); baseMapper.insertExcelEmpProject(proInsList);
for (TEmployeeProject addProject : proInsList) {
// 增加,同步CSP
this.doSaveBelongDept(addProject, CommonConstants.ONE_STRING);
}
} }
if (!proupdateList.isEmpty()) { if (!proupdateList.isEmpty()) {
baseMapper.updateExcelEmpProject(proupdateList); baseMapper.updateExcelEmpProject(proupdateList);
...@@ -1142,6 +1173,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1142,6 +1173,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
list = baseMapper.selectList(Wrappers.<TEmployeeProject>query().lambda().in(TEmployeeProject::getId, ids) list = baseMapper.selectList(Wrappers.<TEmployeeProject>query().lambda().in(TEmployeeProject::getId, ids)
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)); .eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT));
} }
YifuUser user = SecurityUtils.getUser();
if (Common.isNotEmpty(list)) { if (Common.isNotEmpty(list)) {
TEmployeeInfo tEmployeeInfo; TEmployeeInfo tEmployeeInfo;
int i = 0; int i = 0;
...@@ -1158,6 +1190,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1158,6 +1190,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
} }
if (CommonConstants.dingleDigitIntArray[0] == delProject.getStatus()) { if (CommonConstants.dingleDigitIntArray[0] == delProject.getStatus()) {
delProject.setDeleteFlag(CommonConstants.ONE_STRING); delProject.setDeleteFlag(CommonConstants.ONE_STRING);
delProject.setLeaveTime(LocalDateTime.now());
delProject.setLeaveUser(user.getNickname());
updList.add(delProject); updList.add(delProject);
tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda() tEmployeeInfo = tEmployeeInfoMapper.selectOne(Wrappers.<TEmployeeInfo>query().lambda()
.eq(TEmployeeInfo::getEmpIdcard, delProject.getEmpIdcard()) .eq(TEmployeeInfo::getEmpIdcard, delProject.getEmpIdcard())
...@@ -1180,10 +1214,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1180,10 +1214,12 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if (!updList.isEmpty()) { if (!updList.isEmpty()) {
for (TEmployeeProject tEmployeeProject : updList) { for (TEmployeeProject tEmployeeProject : updList) {
baseMapper.updateById(tEmployeeProject); baseMapper.updateById(tEmployeeProject);
// 减少,同步CSP
this.doSaveBelongDept(tEmployeeProject, CommonConstants.TWO_STRING);
} }
} }
if (!infoUpdList.isEmpty()) { if (!infoUpdList.isEmpty()) {
YifuUser user = SecurityUtils.getUser();
doJointTask.doUpdateEmployeeInfo(infoUpdList, user); doJointTask.doUpdateEmployeeInfo(infoUpdList, user);
} }
} }
...@@ -1295,6 +1331,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap ...@@ -1295,6 +1331,8 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
tEmployeeProject.setUnitName(tSettleDomain.getCustomerName()); tEmployeeProject.setUnitName(tSettleDomain.getCustomerName());
} }
baseMapper.insert(tEmployeeProject); baseMapper.insert(tEmployeeProject);
// 增加,同步CSP
this.doSaveBelongDept(tEmployeeProject, CommonConstants.ONE_STRING);
} }
/** /**
......
...@@ -1841,6 +1841,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -1841,6 +1841,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
if (emp == null) { if (emp == null) {
return R.failed("新建员工失败!"); return R.failed("新建员工失败!");
} }
// 增加,同步CSP
tEmployeeProjectService.doSaveBelongDept(project, CommonConstants.ONE_STRING);
// 更新或新增薪资人员 // 更新或新增薪资人员
// 2024-11-6 16:56:46 新逻辑:在项人员,要更新薪资人员,及时卡号为空也要更新 // 2024-11-6 16:56:46 新逻辑:在项人员,要更新薪资人员,及时卡号为空也要更新
if (Common.isNotNull(tPreEmployeeInfo.getBankNo()) || isMustUpdateSalary) { if (Common.isNotNull(tPreEmployeeInfo.getBankNo()) || isMustUpdateSalary) {
......
...@@ -811,6 +811,13 @@ ...@@ -811,6 +811,13 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="LEAVE_USER =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.leaveUser!=null">
when ID=#{i.id} then #{i.leaveUser}
</if>
</foreach>
</trim>
<trim prefix="LEAVE_REMARK =case" suffix="end,"> <trim prefix="LEAVE_REMARK =case" suffix="end,">
<foreach collection="list" item="i" index="index"> <foreach collection="list" item="i" index="index">
<if test="i.leaveRemark!=null"> <if test="i.leaveRemark!=null">
......
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