Commit 88e0f001 authored by fangxinjiang's avatar fangxinjiang

见费出单逻辑-fxj

parent 714e8ea4
......@@ -272,23 +272,57 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
receiveVo.setEmpIdcard(updatePre.getEmpIdcard());
receiveVo.setReason(employeeRegistrationPre.getReason());
receiveVo.setEmployeeId(user.getId());
StringBuilder sb = new StringBuilder();
try {
//调用csp服务更新状态和新增操作记录
cspDaprUtils.updateRegistByPreInfo(receiveVo);
//处理合同待办信息
contractPreMapper.delete(Wrappers.<TEmployeeContractPre>query().lambda()
.eq(TEmployeeContractPre::getRegisterId, updatePre.getId()));
//处理社保待办信息
R<Boolean> booleanR = socialDaprUtils.deleteUnProcessSocialPreInfo(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();
insuranceSearchVo.setRegisterId(updatePre.getId());
insuranceDaprUtil.getInsurancesStatus(insuranceSearchVo);
//处理社保待办信息
socialDaprUtils.deleteUnProcessSocialPreInfo(updatePre.getId());
//处理公积金待办信息
socialDaprUtils.deleteUnProcessFundPreInfo(updatePre.getId());
booleanR = insuranceDaprUtil.delInsurancePreByRegisterId(insuranceSearchVo);
if (null != booleanR && booleanR.getData().booleanValue()){
if (sb.length() > 0){
sb.append("商险");
}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) {
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();
}
......
......@@ -348,8 +348,8 @@ public class SocialDaprUtils {
* @Param
* @return
**/
public void deleteUnProcessSocialPreInfo(String id){
HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl()
public R<Boolean> deleteUnProcessSocialPreInfo(String id){
return HttpDaprUtil.invokeMethodPost(daprProperties.getAppUrl()
, daprProperties.getAppId(),"/tdispatchinfopre/deleteUnProcessSocialPreInfo" , id
, Object.class, SecurityConstants.FROM_IN);
}
......
......@@ -2398,6 +2398,9 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
if (Common.isEmpty(registrationNow)) {
return R.failed(RegistConstants.NO_DATA_TO_HANDLE);
}
if (!CommonConstants.ONE_STRING.equals(registrationNow.getProcessStatus())){
return R.failed("状态非未处理状态,请刷新确认后操作!");
}
registrationNow.setProcessStatus(CommonConstants.THREE_STRING);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING, RegistConstants.BACK_RECEIVE, LocalDateTime.now(),
user.getNickname(), registration.getLeaveReason());
......
......@@ -23,6 +23,18 @@ public interface TBusinessOperateService extends IService<TBusinessOperate> {
*/
<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
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
detail.setUpdateTime(LocalDateTime.now());
detail.setPaymentStatus(CommonConstants.ONE_STRING);
detail.setUpdateBy("05501879fed711eca3540242ac110010");
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保");
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保","EKP系统");
updateList.add(detail);
ids.add(detailId);
}
......@@ -9824,7 +9824,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setUpdateBy("05501879fed711eca3540242ac110010");
detail.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(detail);
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费");
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费","EKP系统");
insuranceIds.add(id);
}
}
......
......@@ -277,7 +277,7 @@ public class DoJointInsuranceTask {
detail.setUpdateBy("05501879fed711eca3540242ac110010");
detail.setUpdateTime(LocalDateTime.now());
//添加日期
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保");
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单已收或垫付同步更新投保状态为待投保","EKP系统");
//更新自动化
LambdaUpdateWrapper<TEmployeeInsurancePre> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TEmployeeInsurancePre::getInsurancesId,detail.getId());
......@@ -296,7 +296,7 @@ public class DoJointInsuranceTask {
detail.setPaymentTime(CommonConstants.EMPTY_STRING);
detail.setUpdateBy("05501879fed711eca3540242ac110010");
detail.setUpdateTime(LocalDateTime.now());
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费");
tBusinessOperateService.saveModificationRecord(detail.getId(),detailOld,detail,"收款结算单退单或撤销匹配同步更新投保状态为待缴费","EKP系统");
}
}
} else {
......
......@@ -359,8 +359,8 @@ public class TDispatchInfoPreController {
@Operation(description = "删除非流程中的社保待购买数据")
@Inner
@PostMapping("/deleteUnProcessSocialPreInfo")
public void deleteUnProcessSocialPreInfo(@RequestBody String id) {
tDispatchInfoPreService.deleteUnProcessSocialPreInfo(id);
public Boolean deleteUnProcessSocialPreInfo(@RequestBody String id) {
return tDispatchInfoPreService.deleteUnProcessSocialPreInfo(id);
}
/**
......@@ -373,8 +373,8 @@ public class TDispatchInfoPreController {
@Operation(description = "删除非流程中的公积金待购买数据")
@Inner
@PostMapping("/deleteUnProcessFundPreInfo")
public void deleteUnProcessFundPreInfo(@RequestBody String id) {
tDispatchInfoPreService.deleteUnProcessFundPreInfo(id);
public Boolean deleteUnProcessFundPreInfo(@RequestBody String id) {
return tDispatchInfoPreService.deleteUnProcessFundPreInfo(id);
}
......
......@@ -77,9 +77,9 @@ public interface TDispatchInfoPreService extends IService<TDispatchInfoPre> {
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
}
@Override
public void deleteUnProcessSocialPreInfo(String id) {
public Boolean deleteUnProcessSocialPreInfo(String id) {
//删除未处理的社保待购买信息
this.remove(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getTypeSub,CommonConstants.ZERO_STRING)
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4","8"))
.eq(TDispatchInfoPre::getRegisterId, id));
socialPreDetailService.remove(Wrappers.<TSocialPreDetail>query().lambda()
return socialPreDetailService.remove(Wrappers.<TSocialPreDetail>query().lambda()
.eq(TSocialPreDetail::getRegisterId, id));
}
@Override
public void deleteUnProcessFundPreInfo(String id) {
public Boolean deleteUnProcessFundPreInfo(String id) {
//删除未处理的公积金待购买信息
this.remove(Wrappers.<TDispatchInfoPre>query().lambda()
.eq(TDispatchInfoPre::getTypeSub,CommonConstants.ONE_STRING)
.in(TDispatchInfoPre::getProcessStatus, Arrays.asList("0", "1", "2", "4","8"))
.eq(TDispatchInfoPre::getRegisterId, id));
socialPreDetailService.remove(Wrappers.<TSocialPreDetail>query().lambda()
return socialPreDetailService.remove(Wrappers.<TSocialPreDetail>query().lambda()
.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