Commit f03a2ee0 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.8' into MVP1.7.8

parents c979d99c 6a59ecd7
...@@ -86,6 +86,8 @@ public interface EmployeeRegistrationPreService extends IService<EmployeeRegistr ...@@ -86,6 +86,8 @@ public interface EmployeeRegistrationPreService extends IService<EmployeeRegistr
void updatePreStatusToEnd(String deptNo, String empIdcard); void updatePreStatusToEnd(String deptNo, String empIdcard);
void updatePreStatusToOne(String deptNo, String empIdcard);
// 更新为待审核 // 更新为待审核
void updatePreStatusToTwo(String deptId, String empIdCard); void updatePreStatusToTwo(String deptId, String empIdCard);
......
...@@ -44,6 +44,19 @@ public interface TEmployeeLogService extends IService<TEmployeeLog> { ...@@ -44,6 +44,19 @@ public interface TEmployeeLogService extends IService<TEmployeeLog> {
**/ **/
<T> TEmployeeLog saveModificationRecord(Integer type, String empId, String projectId, T oldInfo, T newInfo); <T> TEmployeeLog saveModificationRecord(Integer type, String empId, String projectId, T oldInfo, T newInfo);
/**
* 生成修改记录
* @Author pwang
* @Date 2022-06-22 11:32
* @param type 类型:0人员档案;1项目档案;2人员和项目档案;3员工合同更新
* @param empId 档案id
* @param projectId 项目id
* @param oldInfo
* @param newInfo
* @return
**/
<T> TEmployeeLog saveModificationRecord(Integer type, String empId, String projectId, T oldInfo, T newInfo,String userId,String userName);
/** /**
* 生成修改记录 * 生成修改记录
* @Author pwang * @Author pwang
......
...@@ -231,8 +231,11 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -231,8 +231,11 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
if (Common.isNotNull(preVo.getExpectedCollectionTime())) { if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime())); pre.setExpectedCollectionTime(LocalDateTimeUtils.dateToLocalDateTime(preVo.getExpectedCollectionTime()));
} }
if (Common.isNotNull(preExit)) { if (Common.isNotNull(preExit)) {
pre.setId(preExit.getId()); pre.setId(preExit.getId());
baseMapper.deleteById(preExit);
baseMapper.insert(pre);
String natureItemBefore = null; String natureItemBefore = null;
String natureItemAfter = null; String natureItemAfter = null;
String contractItemBefore = null; String contractItemBefore = null;
...@@ -306,6 +309,10 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -306,6 +309,10 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
} }
} }
if (!preExit.getProcessStatus().equals(pre.getProcessStatus())) {
preExit.setProcessStatus(CommonConstants.THREE_STRING.equals(preExit.getProcessStatus()) ? "拒绝入职": "已完成");
pre.setProcessStatus("短信待发放");
}
if (null != natureItemBefore) { if (null != natureItemBefore) {
preExit.setEmpNature(natureItemBefore); preExit.setEmpNature(natureItemBefore);
} }
...@@ -325,46 +332,8 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -325,46 +332,8 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
pre.setContractSubName(contractXfAfter); pre.setContractSubName(contractXfAfter);
} }
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[4], tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[4],
pre.getId().toString(), "", preExit, pre); pre.getId(), "", preExit, pre,pre.getCreateBy(),pre.getCreateName());
baseMapper.deleteById(preExit);
// if (Common.isNotNull(preVo.getServerItem())) {
// pre.setServerItem(preVo.getServerItem());
// }
// if (Common.isNotNull(preVo.getFileProvince())) {
// pre.setFileProvince(preVo.getFileProvince());
// }
// if (Common.isNotNull(preVo.getFileCity())) {
// pre.setFileCity(preVo.getFileCity());
// }
// if (Common.isNotNull(preVo.getFileTown())) {
// pre.setFileTown(preVo.getFileTown());
// } else {
// pre.setFileTown(null);
// }
// if (Common.isNotNull(preVo.getProvinceCode())) {
// pre.setProvinceCode(preVo.getProvinceCode());
// }
// if (Common.isNotNull(preVo.getCityCode())) {
// pre.setCityCode(preVo.getCityCode());
// }
// if (Common.isNotNull(preVo.getTownCode())) {
// pre.setTownCode(preVo.getTownCode());
// } else {
// pre.setTownCode(null);
// }
// if (Common.isNotNull(preVo.getContractType())) {
// pre.setContractType(preVo.getContractType());
// }
// if (Common.isNotNull(preVo.getEmpNature())) {
// pre.setEmpNature(preVo.getEmpNature());
// }
// if (Common.isNotNull(preVo.getContractSubName())) {
// pre.setContractSubName(preVo.getContractSubName());
// }else {
// pre.setContractSubName(null);
// }
} }
baseMapper.insert(pre);
if (Common.isNotNull(preVo.getExpectedCollectionTime())) { if (Common.isNotNull(preVo.getExpectedCollectionTime())) {
// 事务提交后触发调度 // 事务提交后触发调度
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
...@@ -675,6 +644,19 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -675,6 +644,19 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
} }
@Override
public void updatePreStatusToOne(String deptNo, String empIdcard) {
EmployeeRegistrationPre registrationPre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query().lambda()
.eq(EmployeeRegistrationPre::getEmpIdcard, empIdcard)
.eq(EmployeeRegistrationPre::getDeptNo, deptNo)
.eq(EmployeeRegistrationPre::getProcessStatus, CommonConstants.TWO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(registrationPre)) {
registrationPre.setProcessStatus(CommonConstants.ONE_STRING);
baseMapper.updateById(registrationPre);
}
}
@Override @Override
public void updatePreStatusToTwo(String deptId, String empIdCard) { public void updatePreStatusToTwo(String deptId, String empIdCard) {
EmployeeRegistrationPre registrationPre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query().lambda() EmployeeRegistrationPre registrationPre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query().lambda()
......
...@@ -67,6 +67,33 @@ public class TEmployeeLogServiceImpl extends ServiceImpl<TEmployeeLogMapper, TEm ...@@ -67,6 +67,33 @@ public class TEmployeeLogServiceImpl extends ServiceImpl<TEmployeeLogMapper, TEm
return null; return null;
} }
@Override
public <T> TEmployeeLog saveModificationRecord(Integer type, String empId, String projectId, T oldInfo, T newInfo,String userId,String userName) {
try{
//比较记录不影响业务逻辑,用try套住
//比较差异
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
//如果有差异保存差异
if(!Common.isEmpty(differenceKey)){
TEmployeeLog employeeLog = new TEmployeeLog();
employeeLog.setProjectId(projectId);
employeeLog.setType(type);
employeeLog.setEmpId(empId);
employeeLog.setCreateTime(LocalDateTime.now());
employeeLog.setOldInfo(JSON.toJSONString(oldInfo,features));
employeeLog.setNewInfo(JSON.toJSONString(newInfo,features));
employeeLog.setDifferenceInfo(differenceKey);
employeeLog.setCreateBy(userId);
employeeLog.setCreateName(userName);
baseMapper.insert(employeeLog);
return employeeLog;
}
}catch (Exception e){
log.error(JSON.toJSON(oldInfo)+"插入修改记录报错>>>",e);
}
return null;
}
@Override @Override
public <T> TEmployeeLog saveModificationRecord(Integer type, String empId, String projectId, T oldInfo, T newInfo,YifuUser user) { public <T> TEmployeeLog saveModificationRecord(Integer type, String empId, String projectId, T oldInfo, T newInfo,YifuUser user) {
try{ try{
......
...@@ -2878,6 +2878,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE ...@@ -2878,6 +2878,10 @@ public class TPreEmpMainServiceImpl extends ServiceImpl<TPreEmpMainMapper, TPreE
PreEmpMainDetailVo vo = voR.getData(); PreEmpMainDetailVo vo = voR.getData();
tPreEmpMainLogService.save(auditLog); tPreEmpMainLogService.save(auditLog);
this.updateById(preEmpMain); this.updateById(preEmpMain);
if (CommonConstants.THREE_STRING.equals(status)) {
// 更新入职待建档状态为信息待填写
registrationPreService.updatePreStatusToOne(preEmpMain.getDeptNo(),preEmpMain.getEmpIdcard());
}
if (CommonConstants.FOUR_STRING.equals(status)) { if (CommonConstants.FOUR_STRING.equals(status)) {
// true 简档 // true 简档
boolean isSimpleBoo = false; boolean isSimpleBoo = false;
......
...@@ -942,8 +942,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -942,8 +942,8 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (Common.isNotNull(registration)) { if (Common.isNotNull(registration)) {
registration.setProcessStatus(CommonConstants.TWO_STRING); registration.setProcessStatus(CommonConstants.TWO_STRING);
baseMapper.updateById(registration); baseMapper.updateById(registration);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.MESSAGE_FINISH, searchCspVo.getEmpCreateAndLeaveTime(), logService.saveInnerLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.MESSAGE_FINISH, searchCspVo.getEmpCreateAndLeaveTime(),
searchCspVo.getEmpCreateAndLeaveUser(),RegistConstants.BEFORE_IN_PROJECT ); searchCspVo.getEmpCreateAndLeaveUser(),RegistConstants.BEFORE_IN_PROJECT,searchCspVo.getUserId() );
return null; return null;
} else { } else {
List<TEmployeeProjectBelongDept> belongDeptList = baseMapper.getZeroRegistrationByIdCard(searchCspVo); List<TEmployeeProjectBelongDept> belongDeptList = baseMapper.getZeroRegistrationByIdCard(searchCspVo);
......
...@@ -153,6 +153,7 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper, ...@@ -153,6 +153,7 @@ public class TInsuranceWarnServiceImpl extends ServiceImpl<TInsuranceWarnMapper,
String nickName = null; String nickName = null;
String userId = null; String userId = null;
for (TInsuranceAlert alert: list){ for (TInsuranceAlert alert: list){
userId = null;
if (Common.isNotNull(userMap.get(alert.getCreateBy()))){ if (Common.isNotNull(userMap.get(alert.getCreateBy()))){
domain = domainHashMap.get(alert.getDeptNo()); domain = domainHashMap.get(alert.getDeptNo());
if (Common.isNotNull(domain)){ if (Common.isNotNull(domain)){
......
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