Commit 88e0f001 authored by fangxinjiang's avatar fangxinjiang

见费出单逻辑-fxj

parent 714e8ea4
...@@ -272,23 +272,57 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -272,23 +272,57 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
receiveVo.setEmpIdcard(updatePre.getEmpIdcard()); receiveVo.setEmpIdcard(updatePre.getEmpIdcard());
receiveVo.setReason(employeeRegistrationPre.getReason()); receiveVo.setReason(employeeRegistrationPre.getReason());
receiveVo.setEmployeeId(user.getId()); receiveVo.setEmployeeId(user.getId());
StringBuilder sb = new StringBuilder();
try { try {
//调用csp服务更新状态和新增操作记录 //调用csp服务更新状态和新增操作记录
cspDaprUtils.updateRegistByPreInfo(receiveVo); cspDaprUtils.updateRegistByPreInfo(receiveVo);
//处理合同待办信息 //处理社保待办信息
contractPreMapper.delete(Wrappers.<TEmployeeContractPre>query().lambda() R<Boolean> booleanR = socialDaprUtils.deleteUnProcessSocialPreInfo(updatePre.getId());
.eq(TEmployeeContractPre::getRegisterId, updatePre.getId())); if (null != booleanR && booleanR.getData().booleanValue()){
sb.append("社保");
}
//处理公积金待办信息
booleanR = socialDaprUtils.deleteUnProcessFundPreInfo(updatePre.getId());
if (null != booleanR && booleanR.getData().booleanValue()){
if (sb.length() > 0){
sb.append("公积金");
}else {
sb.append("/公积金");
}
}
//处理商险待办信息 //处理商险待办信息
BaseSearchVO insuranceSearchVo = new BaseSearchVO(); BaseSearchVO insuranceSearchVo = new BaseSearchVO();
insuranceSearchVo.setRegisterId(updatePre.getId()); insuranceSearchVo.setRegisterId(updatePre.getId());
insuranceDaprUtil.getInsurancesStatus(insuranceSearchVo); booleanR = insuranceDaprUtil.delInsurancePreByRegisterId(insuranceSearchVo);
//处理社保待办信息 if (null != booleanR && booleanR.getData().booleanValue()){
socialDaprUtils.deleteUnProcessSocialPreInfo(updatePre.getId()); if (sb.length() > 0){
//处理公积金待办信息 sb.append("商险");
socialDaprUtils.deleteUnProcessFundPreInfo(updatePre.getId()); }else {
sb.append("/商险");
}
}
//处理合同待办信息
int res = contractPreMapper.delete(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId, updatePre.getId()));
if (res > 0){
if (sb.length() > 0){
sb.append("/合同");
}else {
sb.append("合同");
}
}
} catch (Exception e) { } catch (Exception e) {
log.error("调用csp服务更新数据异常", e); log.error("调用csp服务更新数据异常", e);
} }
//增加操作日期
TEmployeePreLog log = new TEmployeePreLog();
log.setCreateTime(LocalDateTime.now());
log.setCreateName(user.getNickname());
log.setUpdateTime(LocalDateTime.now());
log.setDiffTitle("联动删除的待办:"+sb);
log.setMenuInfo("入职建档");
return R.ok(); return R.ok();
} }
......
...@@ -348,8 +348,8 @@ public class SocialDaprUtils { ...@@ -348,8 +348,8 @@ public class SocialDaprUtils {
* @Param * @Param
* @return * @return
**/ **/
public void deleteUnProcessSocialPreInfo(String id){ public R<Boolean> deleteUnProcessSocialPreInfo(String id){
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl() return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl()
, daprProperties.getAppId(),"/tdispatchinfopre/deleteUnProcessSocialPreInfo" , id , daprProperties.getAppId(),"/tdispatchinfopre/deleteUnProcessSocialPreInfo" , id
, Object.class, SecurityConstants.FROM_IN); , Object.class, SecurityConstants.FROM_IN);
} }
......
...@@ -2398,6 +2398,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr ...@@ -2398,6 +2398,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (Common.isEmpty(registrationNow)) { if (Common.isEmpty(registrationNow)) {
return R.failed(RegistConstants.NO_DATA_TO_HANDLE); return R.failed(RegistConstants.NO_DATA_TO_HANDLE);
} }
if (!CommonConstants.ONE_STRING.equals(registrationNow.getProcessStatus())){
return R.failed("状态非未处理状态,请刷新确认后操作!");
}
registrationNow.setProcessStatus(CommonConstants.THREE_STRING); registrationNow.setProcessStatus(CommonConstants.THREE_STRING);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.BACK_RECEIVE, LocalDateTime.now(), logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.BACK_RECEIVE, LocalDateTime.now(),
user.getNickname(), registration.getLeaveReason()); user.getNickname(), registration.getLeaveReason());
......
...@@ -23,6 +23,18 @@ public interface TBusinessOperateService extends IService<TBusinessOperate> { ...@@ -23,6 +23,18 @@ public interface TBusinessOperateService extends IService<TBusinessOperate> {
*/ */
<T> TBusinessOperate saveModificationRecord(String businessId, T oldInfo, T newInfo, String remark); <T> TBusinessOperate saveModificationRecord(String businessId, T oldInfo, T newInfo, String remark);
/**
* 保存修改记录
*
* @author licancan
* @param businessId 业务表主键
* @param oldInfo 老的实体类
* @param newInfo 新的实体类
* @param remark 备注
* @return {@link TBusinessOperate}
*/
<T> TBusinessOperate saveModificationRecord(String businessId, T oldInfo, T newInfo, String remark,String userName);
/** /**
* 根据业务主键获取操作记录 * 根据业务主键获取操作记录
* *
......
...@@ -67,6 +67,31 @@ public class TBusinessOperateServiceImpl extends ServiceImpl<TBusinessOperateMap ...@@ -67,6 +67,31 @@ public class TBusinessOperateServiceImpl extends ServiceImpl<TBusinessOperateMap
return null; return null;
} }
@Override
public <T> TBusinessOperate saveModificationRecord(String businessId, T oldInfo, T newInfo, String remark,String userName) {
try{
//比较记录不影响业务逻辑,用try套住
//比较差异
String differenceKey = HrEquator.comparisonValue(oldInfo, newInfo);
//如果有差异保存差异
if(!Common.isEmpty(differenceKey)){
TBusinessOperate operate = new TBusinessOperate();
operate.setBusinessId(businessId);
operate.setCreateTime(LocalDateTime.now());
operate.setOldInfo(JSON.toJSONString(oldInfo,features));
operate.setNewInfo(JSON.toJSONString(newInfo,features));
operate.setDifferenceInfo(differenceKey);
operate.setRemark(remark);
operate.setCreateName(userName);
baseMapper.insert(operate);
return operate;
}
}catch (Exception e){
log.error(JSON.toJSON(oldInfo)+"插入修改记录报错>>>",e);
}
return null;
}
/** /**
* 根据业务主键获取操作记录 * 根据业务主键获取操作记录
* *
......
...@@ -9764,7 +9764,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -9764,7 +9764,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
detail.setPaymentStatus(CommonConstants.ONE_STRING); detail.setPaymentStatus(CommonConstants.ONE_STRING);
detail.setUpdateBy("05501879fed711eca3540242ac110010"); detail.setUpdateBy("05501879fed711eca3540242ac110010");
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保"); tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保","EKP系统");
updateList.add(detail); updateList.add(detail);
ids.add(detailId); ids.add(detailId);
} }
...@@ -9824,7 +9824,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -9824,7 +9824,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setUpdateBy("05501879fed711eca3540242ac110010"); detail.setUpdateBy("05501879fed711eca3540242ac110010");
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(detail); baseMapper.updateById(detail);
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费"); tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费","EKP系统");
insuranceIds.add(id); insuranceIds.add(id);
} }
} }
......
...@@ -277,7 +277,7 @@ public class DoJointInsuranceTask { ...@@ -277,7 +277,7 @@ public class DoJointInsuranceTask {
detail.setUpdateBy("05501879fed711eca3540242ac110010"); detail.setUpdateBy("05501879fed711eca3540242ac110010");
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
//添加日期 //添加日期
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保"); tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保","EKP系统");
//更新自动化 //更新自动化
LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeInsurancePre::getInsurancesId,detail.getId()); updateWrapper.eq(TEmployeeInsurancePre::getInsurancesId,detail.getId());
...@@ -296,7 +296,7 @@ public class DoJointInsuranceTask { ...@@ -296,7 +296,7 @@ public class DoJointInsuranceTask {
detail.setPaymentTime(CommonConstants.EMPTY_STRING); detail.setPaymentTime(CommonConstants.EMPTY_STRING);
detail.setUpdateBy("05501879fed711eca3540242ac110010"); detail.setUpdateBy("05501879fed711eca3540242ac110010");
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费"); tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费","EKP系统");
} }
} }
} else { } else {
......
...@@ -359,8 +359,8 @@ public class TDispatchInfoPreController { ...@@ -359,8 +359,8 @@ public class TDispatchInfoPreController {
@Operation(description = "删除非流程中的社保待购买数据") @Operation(description = "删除非流程中的社保待购买数据")
@Inner @Inner
@PostMapping("/deleteUnProcessSocialPreInfo") @PostMapping("/deleteUnProcessSocialPreInfo")
public void deleteUnProcessSocialPreInfo(@RequestBody String id) { public Boolean deleteUnProcessSocialPreInfo(@RequestBody String id) {
tDispatchInfoPreService.deleteUnProcessSocialPreInfo(id); return tDispatchInfoPreService.deleteUnProcessSocialPreInfo(id);
} }
/** /**
...@@ -373,8 +373,8 @@ public class TDispatchInfoPreController { ...@@ -373,8 +373,8 @@ public class TDispatchInfoPreController {
@Operation(description = "删除非流程中的公积金待购买数据") @Operation(description = "删除非流程中的公积金待购买数据")
@Inner @Inner
@PostMapping("/deleteUnProcessFundPreInfo") @PostMapping("/deleteUnProcessFundPreInfo")
public void deleteUnProcessFundPreInfo(@RequestBody String id) { public Boolean deleteUnProcessFundPreInfo(@RequestBody String id) {
tDispatchInfoPreService.deleteUnProcessFundPreInfo(id); return tDispatchInfoPreService.deleteUnProcessFundPreInfo(id);
} }
......
...@@ -77,9 +77,9 @@ public interface TDispatchInfoPreService extends IService<TDispatchInfoPre> { ...@@ -77,9 +77,9 @@ public interface TDispatchInfoPreService extends IService<TDispatchInfoPre> {
EmployeePreSocialListVo getSocialPreInfoStatus(String id); EmployeePreSocialListVo getSocialPreInfoStatus(String id);
void deleteUnProcessSocialPreInfo(String id); Boolean deleteUnProcessSocialPreInfo(String id);
void deleteUnProcessFundPreInfo(String id); Boolean deleteUnProcessFundPreInfo(String id);
/** /**
* 社保待购买信息单个/批量发起签署任务 * 社保待购买信息单个/批量发起签署任务
......
...@@ -449,26 +449,26 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap ...@@ -449,26 +449,26 @@ public class TDispatchInfoPreServiceImpl extends ServiceImpl<TDispatchInfoPreMap
} }
@Override @Override
public void deleteUnProcessSocialPreInfo(String id) { public Boolean deleteUnProcessSocialPreInfo(String id) {
//删除未处理的社保待购买信息 //删除未处理的社保待购买信息
this.remove(Wrappers.<TDispatchInfoPre>query().lambda() this.remove(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getTypeSub,CommonConstants.ZERO_STRING) .eq(TDispatchInfoPre::getTypeSub,CommonConstants.ZERO_STRING)
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4","8")) .in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4","8"))
.eq(TDispatchInfoPre::getRegisterId, id)); .eq(TDispatchInfoPre::getRegisterId, id));
socialPreDetailService.remove(Wrappers.<TSocialPreDetail>query().lambda() return socialPreDetailService.remove(Wrappers.<TSocialPreDetail>query().lambda()
.eq(TSocialPreDetail::getRegisterId, id)); .eq(TSocialPreDetail::getRegisterId, id));
} }
@Override @Override
public void deleteUnProcessFundPreInfo(String id) { public Boolean deleteUnProcessFundPreInfo(String id) {
//删除未处理的公积金待购买信息 //删除未处理的公积金待购买信息
this.remove(Wrappers.<TDispatchInfoPre>query().lambda() this.remove(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getTypeSub,CommonConstants.ONE_STRING) .eq(TDispatchInfoPre::getTypeSub,CommonConstants.ONE_STRING)
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4","8")) .in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4","8"))
.eq(TDispatchInfoPre::getRegisterId, id)); .eq(TDispatchInfoPre::getRegisterId, id));
socialPreDetailService.remove(Wrappers.<TSocialPreDetail>query().lambda() return socialPreDetailService.remove(Wrappers.<TSocialPreDetail>query().lambda()
.eq(TSocialPreDetail::getRegisterId, id)); .eq(TSocialPreDetail::getRegisterId, id));
} }
......
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