Commit e7be5828 authored by fangxinjiang's avatar fangxinjiang

Merge branch 'develop'

parents 2d72121b 95c95f22
......@@ -390,4 +390,8 @@ public class TEmployeeProject extends BaseEntity {
@Schema(description = "选中的idList")
private List<String> idList;
// 划转前的老项目id,调整社保公积金使用
@TableField(exist = false)
private String odlDeptId;
}
......@@ -11,8 +11,6 @@ import lombok.Data;
public class EmpIdCardAndDeptVo {
// 身份证
private String idCard;
// 项目id
private String deptId;
// 项目编码:薪资使用的,只有编码
private String deptNo;
// 状态
......
......@@ -71,6 +71,6 @@ public class EmployeeConstants {
* @Date: 2022/11/25 16:42
* @return:
**/
public static final String CONTRACT_NAME[] = {"标准合同","劳派遣合同","其他"};
public static final String CONTRACT_NAME[] = {"标准合同","劳派遣合同","其他"};
}
......@@ -317,11 +317,11 @@ public class TEmployeeProjectController {
}
/**
* @Description: 更新人员档案、项目档案的商险状态
* @Description: 更新项目档案的商险状态
* @Author: hgw
* @Date: 2022-11-23 17:17:59
**/
@Operation(summary = "更新人员档案、项目档案的商险状态", description = "更新人员档案、项目档案的商险状态")
@Operation(summary = "更新项目档案的商险状态", description = "更新项目档案的商险状态")
@Inner
@PostMapping("/inner/updateEmployeeInsuranceStatus")
public Boolean updateEmployeeInsuranceStatus(@RequestBody EmpStatusVo vo) {
......
......@@ -193,7 +193,7 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
/**
* @param vo
* @Description: 更新人员档案、项目档案的商险状态
* @Description: 更新项目档案的商险状态
* @Author: hgw
* @Date: 2022/11/23 17:20
* @return: java.lang.Boolean
......
......@@ -114,12 +114,14 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updateTEmployeeProject.setBusinessPrimaryType(tSettleDomain.getBusinessPrimaryType());
updateTEmployeeProject.setBusinessSecondType(tSettleDomain.getBusinessSecondType());
updateTEmployeeProject.setBusinessThirdType(tSettleDomain.getBusinessThirdType());
updateTEmployeeProject.setOdlDeptId(tEmployeeProjectOld.getDeptId());
tEmployeeProjectService.updateById(updateTEmployeeProject);
tEmpChangeInfo.setProId(updateTEmployeeProject.getId());
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", updateTEmployeeProject.getId(), tEmployeeProjectOld, updateTEmployeeProject);
UpdateSocialFoundVo updateSocialFoundVo = new UpdateSocialFoundVo();
updateSocialFoundVo.setOldDeptId(updateTEmployeeProject.getOdlDeptId());
updateSocialFoundVo.setEmpIdcard(updateTEmployeeProject.getEmpIdcard());
updateSocialFoundVo.setSettleDomainCode(updateTEmployeeProject.getDeptNo());
updateSocialFoundVo.setSettleDomainId(updateTEmployeeProject.getDeptId());
......@@ -225,6 +227,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
updateTEmployeePro.setUnitName(tSettleDomain.getCustomerName());
updateTEmployeePro.setChangeStartMonth(excel.getChangeStartMonth());
updateTEmployeePro.setUnsettleDeal(CommonConstants.IS_NO_CHANGE);
updateTEmployeePro.setOdlDeptId(tEmployeeProjectOld.getDeptId());
updateList.add(updateTEmployeePro);
// 记录变更日志
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[1], "", tEmployeeProjectOld.getId(), tEmployeeProjectOld, updateTEmployeePro);
......@@ -244,6 +247,7 @@ public class TEmpChangeInfoServiceImpl extends ServiceImpl<TEmpChangeInfoMapper,
tEmployeeProjectService.updateBatchById(updateList);
for (TEmployeeProject tEmployeeProject: updateList) {
UpdateSocialFoundVo updateSocialFoundVo = new UpdateSocialFoundVo();
updateSocialFoundVo.setOldDeptId(tEmployeeProject.getOdlDeptId());
updateSocialFoundVo.setEmpIdcard(tEmployeeProject.getEmpIdcard());
updateSocialFoundVo.setSettleDomainCode(tEmployeeProject.getDeptNo());
updateSocialFoundVo.setSettleDomainId(tEmployeeProject.getDeptId());
......
......@@ -445,6 +445,27 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
private void updateEmployeeContractStatus(TEmployeeContractInfo tEmployeeContractInfo) {
if (!CommonConstants.ZERO_STRING.equals(tEmployeeContractInfo.getInUse())) {
// 非作废、终止,本条变为在用
if (Common.isEmpty(tEmployeeContractInfo.getSituation())
|| (!EmployeeConstants.SITUATION_SIX.equals(tEmployeeContractInfo.getSituation())
&& !EmployeeConstants.SITUATION_SEVEN.equals(tEmployeeContractInfo.getSituation()))) {
// 其他变为不在用
baseMapper.updateInUseStatusById(tEmployeeContractInfo.getEmpId(), tEmployeeContractInfo.getDeptNo(), tEmployeeContractInfo.getId(), CommonConstants.ONE_STRING);
tEmployeeContractInfo.setAuditTimeLast(LocalDateTime.now());
tEmployeeContractInfo.setInUse(CommonConstants.ZERO_STRING);
baseMapper.updateById(tEmployeeContractInfo);
} else {
// 2022-7-22 16:54:12 产品倩倩与测试说,作废终止审核通过,仅将原先选择的合同不在用即可
if (Common.isNotNull(tEmployeeContractInfo.getOldContractId())) {
TEmployeeContractInfo old = this.getById(tEmployeeContractInfo.getOldContractId());
if (old != null && Common.isNotNull(old.getId()) && CommonConstants.ZERO_STRING.equals(old.getInUse())) {
old.setInUse(CommonConstants.ONE_STRING);
this.updateById(old);
}
}
}
}
TEmployeeInfo employeeInfo = tEmployeeInfoMapper.selectById(tEmployeeContractInfo.getEmpId());
if (employeeInfo != null) {
employeeInfo.setContractStatus(CommonConstants.ONE_INT);
......@@ -1000,14 +1021,14 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
* @return: void
**/
private void judgeAuditStatus(TEmployeeContractInfo insert) {
if (insert.getAuditStatus() != CommonConstants.TWO_INT
if (insert.getAuditStatus() == CommonConstants.ONE_INT
&& (EmployeeConstants.CONTRACT_NAME[0].equals(insert.getContractName())
|| EmployeeConstants.CONTRACT_NAME[1].equals(insert.getContractName())
|| EmployeeConstants.CONTRACT_NAME[2].equals(insert.getContractName()))) {
//
TSocialFundInfo sf = new TSocialFundInfo();
sf.setEmpIdcard(insert.getEmpIdcard());
sf.setSettleDomainCode(insert.getDeptNo());
sf.setSettleDomain(insert.getSettleDomain());
R<Integer> socialFundR = HttpDaprUtil.invokeMethodPost(socialProperties.getAppUrl(), socialProperties.getAppId()
, "/tsocialfundinfo/inner/selectSocialFoundByContract", sf, Integer.class, SecurityConstants.FROM_IN);
if (socialFundR != null && socialFundR.getData() != null && socialFundR.getData() > 0) {
......
......@@ -1354,7 +1354,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
/**
* @Description: 更新人员、项目档案的商险状态
* @Description: 更新项目档案的商险状态
* @Author: hgw
* @Date: 2022/11/23 17:45
* @return: java.lang.Boolean
......@@ -1366,7 +1366,6 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
}
for (EmpIdCardAndDeptVo emp : vo.getEmpInfo()) {
baseMapper.updateEmployeeInsuranceStatus(emp);
tEmployeeInfoMapper.updateEmployeeInfoInsuranceStatus(emp);
}
return true;
}
......
......@@ -852,7 +852,7 @@
<!-- 更新项目档案商险状态 -->
<update id="updateEmployeeInsuranceStatus" >
update t_employee_project a set a.INSURANCE_STATUS = #{emp.status} where a.EMP_IDCARD = #{emp.idCard} and a.DEPT_ID = #{emp.deptId}
update t_employee_project a set a.INSURANCE_STATUS = #{emp.status} where a.EMP_IDCARD = #{emp.idCard} and a.DEPT_NO = #{emp.deptNo}
</update>
<!-- 更新项目档案薪资状态 -->
......
......@@ -311,7 +311,7 @@ public class ArchivesDaprUtil {
}
/**
* @Description: 更新人员档案与项目档案,状态一致。商险的status 0无2正常3失效4处理中
* @Description: 更新项目档案的商险状态。商险的status 0无2正常3失效4处理中
* @Author: hgw
* @Date: 2022/11/23 15:29
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.Boolean>
......@@ -322,7 +322,7 @@ public class ArchivesDaprUtil {
,"/temployeeproject/inner/updateEmployeeInsuranceStatus"
, JSON.toJSONString(empStatusVo) , Boolean.class, SecurityConstants.FROM_IN);
if (Common.isEmpty(res)){
return R.failed("更新【人员档案、项目档案】的商险状态失败!");
return R.failed("更新【项目档案】的商险状态失败!");
}
return res;
}
......
......@@ -134,12 +134,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// 过期同步档案逻辑:
List<String> sourceIdCardList = new ArrayList<>();
List<String> replaceIdList = new ArrayList<>();
List<TInsuranceDetail> changeList = new ArrayList<>();
list.stream().forEach(e -> {
if (!LocalDateUtil.isOverdueDate(e.getPolicyEnd().toString())){
e.setIsOverdue(CommonConstants.ONE_INT);
e.setUpdateTime(LocalDateTime.now());
sourceIdCardList.add(e.getEmpIdcardNo());
replaceIdList.add(e.getId());
if (Common.isEmpty(e.getBuyHandleStatus()) || e.getBuyHandleStatus() != CommonConstants.FOUR_INT) {
changeList.add(e);
sourceIdCardList.add(e.getEmpIdcardNo());
replaceIdList.add(e.getId());
}
}
});
......@@ -148,7 +152,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
log.info("定时任务扫描到的已过期数据是:{}条",collect.size());
this.updateBatchById(collect);
}
this.doFailInfo(collect, sourceIdCardList, replaceIdList, CommonConstants.THREE_STRING);
this.doFailInfo(changeList, sourceIdCardList, replaceIdList, CommonConstants.THREE_STRING);
}
}
......@@ -334,7 +338,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<TInsuranceDetail> detailList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(listSuccess)){
List<String> sourceIdCardList = new ArrayList<>();
List<String> replaceIdList = new ArrayList<>();
for (InsuranceAddParam success : listSuccess) {
TInsuranceDetail detail = new TInsuranceDetail();
BeanCopyUtils.copyProperties(success,detail);
......@@ -354,9 +357,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setCreateName(user.getNickname());
detailList.add(detail);
sourceIdCardList.add(detail.getEmpIdcardNo());
replaceIdList.add(detail.getId());
}
this.saveBatch(detailList);
List<String> replaceIdList = new ArrayList<>();
for (TInsuranceDetail d : detailList) {
replaceIdList.add(d.getId());
}
// 同步操作档案的 商险状态为:2正常(0无2正常3失效4处理中)
this.doFailInfo(detailList, sourceIdCardList, replaceIdList, CommonConstants.FOUR_STRING);
}
......@@ -1144,6 +1150,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceListVO> errorList = new ArrayList<>();
//后端处理的数据
List<TInsuranceDetail> successList = new ArrayList<>();
//被替换人的档案要处理状态
List<String> sourceIdCardList = new ArrayList<>();
// 被替换的id
List<String> replaceIdList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(detailList)){
for (TInsuranceDetail detail : detailList) {
if (detail.getBuyHandleStatus() == CommonConstants.FOUR_INT
......@@ -1196,6 +1206,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setUpdateTime(LocalDateTime.now());
detail.setBackRemark(remarkMap.get(detail.getId()));
successList.add(detail);
sourceIdCardList.add(detail.getEmpIdcardNo());
replaceIdList.add(detail.getId());
}
}
}
......@@ -1286,6 +1298,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
//更新状态
this.saveOrUpdateBatch(successList);
// 处理档案状态
if (CollectionUtils.isNotEmpty(successList)) {
this.doFailInfo(successList, sourceIdCardList, replaceIdList, CommonConstants.ZERO_STRING);
}
}
//操作记录
addOperate(operateList,user,InsurancesConstants.ROLLBACK);
......@@ -1323,7 +1340,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
handleParam.setRemark(e.getRemark());
list.add(handleParam);
});
// TODO-关联档案1
// 关联档案1
this.successfulInsurance(user,list);
}
......@@ -1336,7 +1353,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
handleParam.setRemark(e.getRemark());
list.add(handleParam);
});
// TODO-关联档案2
// 关联档案2
this.rollBackInsurance(user,list);
}
}
......@@ -1560,31 +1577,40 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
Map<String , Integer> proStatusMap = new HashMap<>();
// 人员档案状态
Map<String , Integer> empStatusMap = new HashMap<>();
for (TInsuranceDetail detail : sourceList) {
proStatusMap.put(detail.getEmpIdcardNo() + CommonConstants.DOWN_LINE_STRING + detail.getDeptNo(), Integer.parseInt(toStatus));
empStatusMap.put(detail.getEmpIdcardNo(), Integer.parseInt(toStatus));
}
Integer proStatus;
Integer empStatus;
int status;
for (TInsuranceDetail detail : sourceEmpList) {
proStatus = proStatusMap.get(detail.getEmpIdcardNo() + CommonConstants.DOWN_LINE_STRING + detail.getDeptId());
proStatus = proStatusMap.get(detail.getEmpIdcardNo() + CommonConstants.DOWN_LINE_STRING + detail.getDeptNo());
empStatus = empStatusMap.get(detail.getEmpIdcardNo());
// 判断该项目的商险的状态 2正常>3处理中>4失效>0无商险
// 判断该项目的商险的状态 2正常>4处理中>3失效>0无商险
// 0无2正常3失效4处理中
status = this.judgeStatus(detail);
if (proStatus != null) {
if (status != 0 && status < proStatus) {
proStatus = status;
if (proStatus != CommonConstants.TWO_INT && (status == CommonConstants.TWO_INT
|| status == CommonConstants.FOUR_INT
|| (status == CommonConstants.THREE_INT && proStatus != CommonConstants.FOUR_INT))) {
proStatus = status;
}
} else {
proStatus = status;
}
if (empStatus != null) {
if (status != 0 && status < empStatus) {
if (empStatus != CommonConstants.TWO_INT && (status == CommonConstants.TWO_INT
|| status == CommonConstants.FOUR_INT
|| (status == CommonConstants.THREE_INT && empStatus != CommonConstants.FOUR_INT))) {
empStatus = status;
}
} else {
empStatus = status;
}
proStatusMap.put(detail.getEmpIdcardNo()+CommonConstants.DOWN_LINE_STRING+detail.getDeptId(), proStatus);
proStatusMap.put(detail.getEmpIdcardNo()+CommonConstants.DOWN_LINE_STRING+detail.getDeptNo(), proStatus);
empStatusMap.put(detail.getEmpIdcardNo(), empStatus);
}
if (!proStatusMap.isEmpty()) {
......@@ -1610,12 +1636,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
**/
private EmpStatusVo getEmpStatusVo(Map<String, Integer> empStatusMap, boolean isDept) {
EmpStatusVo empStatusVo = new EmpStatusVo();
EmpIdCardAndDeptVo empIdCardAndDeptVo = new EmpIdCardAndDeptVo();
EmpIdCardAndDeptVo empIdCardAndDeptVo;
List<EmpIdCardAndDeptVo> voList = new ArrayList<>();
for (Map.Entry<String, Integer> entry : empStatusMap.entrySet()) {
empIdCardAndDeptVo = new EmpIdCardAndDeptVo();
if (isDept) {
empIdCardAndDeptVo.setIdCard(entry.getKey().split(CommonConstants.DOWN_LINE_STRING)[0]);
empIdCardAndDeptVo.setDeptId(entry.getKey().split(CommonConstants.DOWN_LINE_STRING)[1]);
empIdCardAndDeptVo.setDeptNo(entry.getKey().split(CommonConstants.DOWN_LINE_STRING)[1]);
} else {
empIdCardAndDeptVo.setIdCard(entry.getKey());
}
......@@ -1637,15 +1664,15 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// (0无2正常3失效4处理中)
if (detail.getBuyHandleStatus() == CommonConstants.FOUR_INT) {
return CommonConstants.ZERO_INT;
} else if (detail.getIsEffect() == CommonConstants.ZERO_INT
&& detail.getIsOverdue() == CommonConstants.ZERO_INT
&& (detail.getBuyHandleStatus() == CommonConstants.THREE_INT
} else if ((Common.isEmpty(detail.getIsEffect()) || detail.getIsEffect() == CommonConstants.ZERO_INT)
&& (Common.isEmpty(detail.getIsOverdue()) || detail.getIsOverdue() == CommonConstants.ZERO_INT)
&& ((Common.isEmpty(detail.getBuyHandleStatus()) || detail.getBuyHandleStatus() == CommonConstants.THREE_INT)
&& (Common.isEmpty(detail.getReduceHandleStatus()) || detail.getReduceHandleStatus() != CommonConstants.FOUR_INT))) {
return CommonConstants.TWO_INT;
} else if (detail.getIsOverdue() == CommonConstants.ONE_INT
|| detail.getIsEffect() == CommonConstants.ONE_INT
|| detail.getReduceHandleStatus() == CommonConstants.FOUR_INT
|| detail.getBuyHandleStatus() == CommonConstants.FIVE_INT) {
} else if ((Common.isNotNull(detail.getIsOverdue()) && detail.getIsOverdue() == CommonConstants.ONE_INT)
|| (Common.isNotNull(detail.getIsEffect()) && detail.getIsEffect() == CommonConstants.ONE_INT)
|| (Common.isNotNull(detail.getReduceHandleStatus()) && detail.getReduceHandleStatus() == CommonConstants.FOUR_INT)
|| (Common.isNotNull(detail.getBuyHandleStatus()) && detail.getBuyHandleStatus() == CommonConstants.FIVE_INT)) {
return CommonConstants.THREE_INT;
} else {
return CommonConstants.FOUR_INT;
......@@ -1660,16 +1687,18 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
**/
private void updateEmpInfp(List<TInsuranceDetail> sourceList, String status) {
EmpStatusVo empStatusVo = new EmpStatusVo();
EmpIdCardAndDeptVo empIdCardAndDeptVo = new EmpIdCardAndDeptVo();
EmpIdCardAndDeptVo empIdCardAndDeptVo;
List<EmpIdCardAndDeptVo> voList = new ArrayList<>();
for (TInsuranceDetail d : sourceList) {
empIdCardAndDeptVo = new EmpIdCardAndDeptVo();
empIdCardAndDeptVo.setIdCard(d.getEmpIdcardNo());
empIdCardAndDeptVo.setDeptId(d.getDeptId());
empIdCardAndDeptVo.setDeptNo(d.getDeptNo());
empIdCardAndDeptVo.setStatus(status);
voList.add(empIdCardAndDeptVo);
}
empStatusVo.setEmpInfo(voList);
archivesDaprUtil.updateEmployeeInsuranceStatus(empStatusVo);
archivesDaprUtil.updateEmployeeInfoInsuranceStatus(empStatusVo);
}
/**
......@@ -3942,6 +3971,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<TInsuranceDetail> successList = new ArrayList<>();
List<TInsuranceDetail> tInsuranceDetails = this.listByIds(insuranceDetailList);
List<TInsuranceRefund> refundList = new ArrayList<>();
//被替换人的档案要处理状态
List<String> sourceIdCardList = new ArrayList<>();
// 被替换的id
List<String> replaceIdList = new ArrayList<>();
for (TInsuranceDetail tInsuranceDetail : tInsuranceDetails) {
TInsuranceRefund refund = new TInsuranceRefund();
RefundErrorVo refundErrorVo = new RefundErrorVo();
......@@ -3968,6 +4001,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceDetail.setUpdateBy(user.getId());
tInsuranceDetail.setUpdateTime(LocalDateTime.now());
successList.add(tInsuranceDetail);
sourceIdCardList.add(tInsuranceDetail.getEmpIdcardNo());
replaceIdList.add(tInsuranceDetail.getId());
//更新减员记录
refund.setId(tInsuranceDetail.getRefundId());
refund.setUpdateBy(user.getId());
......@@ -3984,6 +4019,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceRefundService.updateByInsDetailId(refund);
}
updateBatchById(successList);
// 减员失效
this.doFailInfo(successList, sourceIdCardList, replaceIdList, CommonConstants.THREE_STRING);
//操作记录
if(CommonConstants.FOUR_INT == refundType){
addOperate(successList,user,InsurancesConstants.INSURANCE_REFUND_SUCCESS,remark,CommonConstants.ONE_INT);
......@@ -4015,27 +4052,34 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<InsuranceHandleImportParam> errorList = map.get(InsurancesConstants.ERROR_LIST);
//减员退回
List<TInsuranceOperate> operateList =new ArrayList<>(16);
List<TInsuranceDetail> sourceList = new ArrayList<>();
//被替换人的档案要处理状态
List<String> sourceIdCardList = new ArrayList<>();
// 被替换的id
List<String> replaceIdList = new ArrayList<>();
if (CollectionUtils.isNotEmpty(successList)) {
TInsuranceOperate operate;
TInsuranceDetail detail;
for (InsuranceHandleImportParam param : successList) {
TInsuranceOperate operate = new TInsuranceOperate();
operate = new TInsuranceOperate();
LambdaUpdateWrapper<TInsuranceRefund> refund = new LambdaUpdateWrapper<>();
refund.eq(TInsuranceRefund :: getInsDetailId ,param.getId())
//.set(TInsuranceRefund :: getRemark,param.getRemark())
.set(TInsuranceRefund :: getUpdateTime,LocalDateTime.now())
.set(TInsuranceRefund :: getUpdateBy,user.getId());
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail::getId, param.getId())
.set(TInsuranceDetail::getUpdateBy, user.getId())
.set(TInsuranceDetail::getUpdateTime, LocalDateTime.now());
detail = this.getById(param.getId());
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now());
if(InsurancesConstants.SUCCESS.equals(param.getHandType())){
updateWrapper.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.FOUR_INT);
updateWrapper.set(TInsuranceDetail :: getBuyHandleStatus,CommonConstants.FIVE_INT);
detail.setReduceHandleStatus(CommonConstants.FOUR_INT);
detail.setBuyHandleStatus(CommonConstants.FIVE_INT);
refund.set(TInsuranceRefund :: getReduceHandleStatus,CommonConstants.FOUR_INT);
}else{
updateWrapper.set(TInsuranceDetail:: getReduceHandleStatus,CommonConstants.THREE_INT);
detail.setReduceHandleStatus(CommonConstants.THREE_INT);
refund.set(TInsuranceRefund :: getReduceHandleStatus,CommonConstants.THREE_INT);
}
update(updateWrapper);
this.updateById(detail);
sourceList.add(detail);
tInsuranceRefundService.update(refund);
operate.setInsuranceDetailId(param.getId());
operate.setRemark(param.getRemark());
......@@ -4049,9 +4093,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
operate.setOperateDesc(InsurancesConstants.INSURANCE_REFUND_FAILED);
}
operateList.add(operate);
sourceIdCardList.add(detail.getEmpIdcardNo());
replaceIdList.add(detail.getId());
}
}
tInsuranceOperateService.saveBatch(operateList);
// 减员失效
this.doFailInfo(sourceList, sourceIdCardList, replaceIdList, CommonConstants.THREE_STRING);
return R.ok(errorList, InsurancesConstants.IMPORT_SUCCESS);
}
......
......@@ -26,4 +26,6 @@ public class UpdateSocialFoundVo {
private String socialCreateMonth;
private String flag;
private String oldDeptId;
}
......@@ -659,31 +659,6 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
}
}
/**
* @param isDept true :含项目,要分割字符串; false:不含项目,直接用身份证,仅更新人员档案
* @Description: 提取方法,塞值
* @Author: hgw
* @Date: 2022/11/23 16:48
* @return: com.yifu.cloud.plus.v1.yifu.archives.vo.EmpStatusVo
**/
private EmpStatusVo getEmpStatusVo(Map<String, Integer> empStatusMap, boolean isDept) {
EmpStatusVo empStatusVo = new EmpStatusVo();
EmpIdCardAndDeptVo empIdCardAndDeptVo = new EmpIdCardAndDeptVo();
List<EmpIdCardAndDeptVo> voList = new ArrayList<>();
for (Map.Entry<String, Integer> entry : empStatusMap.entrySet()) {
if (isDept) {
empIdCardAndDeptVo.setIdCard(entry.getKey().split(CommonConstants.DOWN_LINE_STRING)[0]);
empIdCardAndDeptVo.setDeptId(entry.getKey().split(CommonConstants.DOWN_LINE_STRING)[1]);
} else {
empIdCardAndDeptVo.setIdCard(entry.getKey());
}
empIdCardAndDeptVo.setStatus(String.valueOf(entry.getValue()));
voList.add(empIdCardAndDeptVo);
}
empStatusVo.setEmpInfo(voList);
return empStatusVo;
}
/**
* @Description: 添加流程进展明细
* @Author: hgw
......
......@@ -67,6 +67,22 @@ public interface TSocialFundInfoMapper extends BaseMapper<TSocialFundInfo> {
void updateSocialAndFoundInfoF(@Param("infoVo") UpdateSocialFoundVo infoVo);
/**
* @Description: 划转同步更新社保
* @Author: hgw
* @Date: 2022/11/30 17:36
* @return: void
**/
void updateSocialInfo(@Param("infoVo") UpdateSocialFoundVo infoVo);
/**
* @Description: 划转同步更新公积金
* @Author: hgw
* @Date: 2022/11/30 17:36
* @return: void
**/
void updateFundInfo(@Param("infoVo") UpdateSocialFoundVo infoVo);
int selectSocialFoundByContract(@Param("tSocialFundInfo") TSocialFundInfo tSocialFundInfo);
}
......@@ -1349,10 +1349,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(empVo)){
fund.setEmpId(empVo.getId());
fund.setEmpNo(empVo.getEmpNo());
fund.setSettleDomain(empVo.getDeptId());
fund.setEmpIdcard(empVo.getEmpIdcard());
fund.setEmpName(empVo.getEmpName());
}else {
fund.setEmpIdcard(excel.getEmpIdcard());
fund.setEmpName(excel.getEmpName());
}
fund.setEmpIdcard(excel.getEmpIdcard());
fund.setEmpName(excel.getEmpName());
fund.setTrustRemark(excel.getTrustRemark());
fund.setUnitProvidengCardinal(excel.getProvidentCardinal());
fund.setPersonalProvidentCardinal(excel.getProvidentCardinal());
......
......@@ -990,7 +990,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
continue;
}
if (socialInfo != null && socialInfo.getSocialStartDate() == null) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpIdcard() , "的社保起缴日期为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpIdcard() , SocialConstants.ERROR_TEMPLATE + "的社保起缴日期为空!"));
continue;
}
......@@ -1005,8 +1005,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (pensionMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitPensionMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalPensionMoney())), pensionMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() , "的养老缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的养老缴费数据"));
continue;
} else {
pensionMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(infoVo.getUnitPensionMoney()),
......@@ -1017,8 +1016,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (accrualMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getPersonalAccrual()), BigDecimalUtils.isNullToZero(
infoVo.getCompanyAccrual())), accrualMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() , "的补缴缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的补缴缴费数据"));
continue;
} else {
accrualMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -1030,8 +1028,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (medicalMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitMedicalMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalMedicalMoney())), medicalMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() , "的医保缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的医保缴费数据"));
continue;
} else {
medicalMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -1043,8 +1040,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (unEmpMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitUnemploymentMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalUnemploymentMoney())), unEmpMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() , "的失业缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的失业缴费数据"));
continue;
} else {
unEmpMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -1055,8 +1051,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
exitMoney = infoVo.getEmpIdcard().concat(infoVo.getSocialPayMonth().concat(infoVo.getSocialCreateMonth()).concat(SocialConstants.GS));
if (injuryMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.isNullToZero(infoVo.getUnitInjuryMoney()),
injuryMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() , "的工伤缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的工伤缴费数据"));
continue;
} else {
injuryMoneyMap.put(exitMoney, BigDecimalUtils.isNullToZero(infoVo.getUnitInjuryMoney()));
......@@ -1065,8 +1060,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
exitMoney = infoVo.getEmpIdcard().concat(infoVo.getSocialPayMonth().concat(infoVo.getSocialCreateMonth()).concat(SocialConstants.BIR));
if (birMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.isNullToZero(infoVo.getUnitBirthMoney()),
birMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() , "的生育缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的生育缴费数据"));
continue;
} else {
birMoneyMap.put(exitMoney, BigDecimalUtils.isNullToZero(infoVo.getUnitBirthMoney()));
......@@ -1077,8 +1071,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getUnitBigmailmentMoney()),
BigDecimalUtils.isNullToZero(infoVo.getPersonalBigmailmentMoney())),
bigMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() , "的医疗救助金缴费数据"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), infoVo.getSocialHousehold(), infoVo.getProvidentHousehold(), infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的医疗救助金缴费数据"));
continue;
} else {
bigMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -2063,7 +2056,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
continue;
}
if (socialInfo != null && socialInfo.getSocialStartDate() == null) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName() , "的社保起缴日期为空!"));
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的社保起缴日期为空!"));
continue;
}
}
......@@ -2081,7 +2074,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalMoney()), BigDecimalUtils.isNullToZero(
infoVo.getUnitMoney())), pensionMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() , "的养老缴费数据"));
infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的养老缴费数据"));
continue;
} else {
pensionMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(infoVo.getPersonalMoney()),
......@@ -2118,7 +2111,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getUnitMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalMoney())), unEmpMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() , "的失业缴费数据"));
infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的失业缴费数据"));
continue;
} else {
unEmpMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -2156,7 +2149,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getUnitMedicalMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalMedicalMoney())), medicalMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() , "的医保缴费数据"));
infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的医保缴费数据"));
continue;
} else {
medicalMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -2196,7 +2189,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getUnitMoney())),
injuryMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() , "的工伤缴费数据"));
infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的工伤缴费数据"));
continue;
} else {
injuryMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......@@ -2235,7 +2228,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalBigailmentMoney())),
bigMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() , "的医疗救助金缴费数据"));
infoVo.getEmpName() , SocialConstants.ERROR_TEMPLATE + "的医疗救助金缴费数据"));
continue;
} else {
bigMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
......
......@@ -784,8 +784,10 @@ public class TSocialFundInfoServiceImpl extends ServiceImpl<TSocialFundInfoMappe
if (Common.isNotNull(infoVo) && Common.isNotNull(infoVo.getFlag())) {
if (CommonConstants.ZERO_STRING.equals(infoVo.getFlag())) {
baseMapper.updateSocialAndFoundInfo(infoVo);
baseMapper.updateSocialInfo(infoVo);
}else {
baseMapper.updateSocialAndFoundInfoF(infoVo);
baseMapper.updateFundInfo(infoVo);
}
}
}
......
......@@ -1071,17 +1071,34 @@
where EMP_IDCARD = #{infoVo.empIdcard}
</update>
<update id="updateSocialInfo">
update t_social_info
set SETTLE_DOMAIN = #{infoVo.settleDomainId}
where EMP_IDCARD = #{infoVo.empIdcard} and SETTLE_DOMAIN = #{infoVo.oldDeptId}
</update>
<update id="updateFundInfo">
update t_provident_fund
set SETTLE_DOMAIN = #{infoVo.settleDomainId}
where EMP_IDCARD = #{infoVo.empIdcard} and SETTLE_DOMAIN = #{infoVo.oldDeptId}
</update>
<!--获取count,合同使用-->
<select id="selectSocialFoundByContract" resultType="java.lang.Integer">
SELECT
count(1)
FROM t_social_fund_info a
where a.EMP_IDCARD = #{tSocialFundInfo.empIdcard} and
(
(a.SETTLE_DOMAIN_CODE = #{tSocialFundInfo.settleDomainCode} and a.SOCIAL_REDUCE_STATUS='2' and (a.SETTLE_DOMAIN_CODE_FUND is null or a.SETTLE_DOMAIN_CODE_FUND != #{tSocialFundInfo.settleDomainCode} or a.FUND_REDUCE_STATUS='2'))
or
(a.SETTLE_DOMAIN_CODE_FUND = #{tSocialFundInfo.settleDomainCode} and a.FUND_REDUCE_STATUS='2' and (a.SETTLE_DOMAIN_CODE is null or a.SETTLE_DOMAIN_CODE != #{tSocialFundInfo.settleDomainCode} or a.SOCIAL_REDUCE_STATUS='2'))
)
select count(1) from
(SELECT
a.EMP_IDCARD,a.HANDLE_STATUS social_status
FROM t_social_info a
where a.EMP_IDCARD = #{tSocialFundInfo.empIdcard} and a.SETTLE_DOMAIN = #{tSocialFundInfo.settleDomain} ORDER BY a.CREATE_TIME desc limit 1) a
left join
(SELECT
a.EMP_IDCARD,a.HANDLE_STATUS fund_status
FROM t_provident_fund a
where a.EMP_IDCARD = #{tSocialFundInfo.empIdcard} and a.SETTLE_DOMAIN = #{tSocialFundInfo.settleDomain} ORDER BY a.CREATE_TIME desc limit 1) b
on a.EMP_IDCARD=b.EMP_IDCARD
where
(a.social_status='3' and b.fund_status='3' )
or (a.social_status='3' and b.fund_status is null )
or (a.social_status is null and b.fund_status ='3' )
</select>
</mapper>
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