Commit 407c6ea9 authored by fangxinjiang's avatar fangxinjiang

派增

parent b7f4cf7e
......@@ -9,6 +9,17 @@ import java.io.Serializable;
* @Author fxj
* @Date 2022/8/5
* @Description
* 派增:
* * 1、派单处社保或公积金状态为待审核、待办理、办理中,项目档案处社保或公积金状态为处理中1;
* * 2、派单处社保或公积金状态为审核不通过或办理失败,项目档案处社保状态为无社保,公积金状态为无公积金0;
* * 3、派单处社保状态为部分办理失败,项目档案处社保状态为部分购买 2
* * 4、派单处社保或公积金状态为办理成功,项目档案处社保或公积金状态为正常 3
* * 派减:
* * 1、派减状态为待审核、待办理、审核不通过、办理失败,项目档案处社保或公积金状态不变;
* * 2、派减状态为办理成功,项目档案处社保或公积金状态变为已派减 4
* * 人员档案处社保或公积金状态根据身份证+项目进行整合:
* * 社保状态优先级:正常>部分购买>处理中>已派减>无社保
* * 公积金状态优先级:正常>处理中>已派减>无公积金
* @Version 1.0
*/
@Data
......
......@@ -56,12 +56,12 @@ public interface TEmployeeContractInfoMapper extends BaseMapper<TEmployeeContrac
* @Author fxj
* @Date 2019-10-17
* @param empId
* @param deptId
* @param deptNo
* @param id
* @param status
* @return
**/
int updateInUseStatusById(@Param("empId")String empId, @Param("deptId")String deptId
int updateInUseStatusById(@Param("empId")String empId, @Param("deptNo")String deptNo
, @Param("id")String id, @Param("status")String status);
/**
......
......@@ -97,7 +97,7 @@ public interface TEmployeeContractInfoService extends IService<TEmployeeContract
String getCode(boolean isNew);
boolean updateInUseStatusById(String empId, String deptId, String ContractId);
boolean updateInUseStatusById(String empId, String deptNo, String ContractId);
/**
* @param tEmployeeContractInfo
......
......@@ -406,8 +406,8 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
}
}
@Override
public boolean updateInUseStatusById(String empId,String deptId,String ContractId){
return baseMapper.updateInUseStatusById(empId, deptId, ContractId, CommonConstants.ONE_STRING) >0;
public boolean updateInUseStatusById(String empId,String deptNo,String ContractId){
return baseMapper.updateInUseStatusById(empId, deptNo, ContractId, CommonConstants.ONE_STRING) >0;
}
@Override
public R<String> auditContract(TEmployeeContractInfo tEmployeeContractInfo) {
......
......@@ -2129,14 +2129,16 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
.eq(TEmployeeContractInfo::getDispatchFlag,CommonConstants.ONE_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(c)){
//审核通过
if (CommonConstants.ZERO_STRING.equals(vo.getType())){
c.setAuditStatus(CommonConstants.TWO_INT);
c.setInUse(CommonConstants.ZERO_STRING);
contractServicer.updateInUseStatusById(c.getEmpId(),c.getDeptNo(),c.getId());
//审核不同
}else if (CommonConstants.ONE_STRING.equals(vo.getType())){
c.setAuditStatus(CommonConstants.THREE_INT);
c.setInUse(CommonConstants.ONE_STRING);
}
contractServicer.updateInUseStatusById(c.getEmpId(),c.getDeptNo(),c.getSettleDomain());
contractServicer.updateById(c);
}
......
......@@ -455,7 +455,7 @@
<update id="updateInUseStatusById">
update t_employee_contract_info
set IN_USE = #{status}
where EMP_ID = #{empId} and SETTLE_DOMAIN = #{deptId} and ID != #{id}
where EMP_ID = #{empId} and DEPT_NO = #{deptNo} and ID != #{id}
</update>
<!-- 获取当日最大的编码 -->
......
......@@ -488,4 +488,8 @@ public interface ErrorCodes {
* 派增异常: 同一身份证不可分多行派单
*/
String EMP_DISPATCH_EXIST = "emp_dispatch_exist";
/**
* 派增异常: 已存在兼职工伤,请派减后再派增五险
*/
String EMP_DISPATCH_SOCIAL_INJURY_EXISTING_LIMIT = "emp.dispatch.social.injury.existing.limit";
}
......@@ -187,6 +187,8 @@ emp.dispatch.emp.mobile.repeat=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5DF2\u5B58\u5728
emp_dispatch_exist=\u6D3E\u589E\u5F02\u5E38\uFF1A \u540C\u4E00\u8EAB\u4EFD\u8BC1\u4E0D\u53EF\u5206\u591A\u884C\u6D3E\u5355
emp.dispatch.social.injury.existing.limit=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5DF2\u5B58\u5728\u517C\u804C\u5DE5\u4F24\uFF0C\u8BF7\u6D3E\u51CF\u540E\u518D\u6D3E\u589E\u4E94\u9669
......
......@@ -226,6 +226,17 @@ public class ArchivesDaprUtil {
/**
* @Author fxj
* @Description 更新项目档案和人员档案的社保公积金状态
* 派增:
* * 1、派单处社保或公积金状态为待审核、待办理、办理中,项目档案处社保或公积金状态为处理中1;
* * 2、派单处社保或公积金状态为审核不通过或办理失败,项目档案处社保状态为无社保,公积金状态为无公积金0;
* * 3、派单处社保状态为部分办理失败,项目档案处社保状态为部分购买 2
* * 4、派单处社保或公积金状态为办理成功,项目档案处社保或公积金状态为正常 3
* * 派减:
* * 1、派减状态为待审核、待办理、审核不通过、办理失败,项目档案处社保或公积金状态不变;
* * 2、派减状态为办理成功,项目档案处社保或公积金状态变为已派减 4
* * 人员档案处社保或公积金状态根据身份证+项目进行整合:
* * 社保状态优先级:正常>部分购买>处理中>已派减>无社保
* * 公积金状态优先级:正常>处理中>已派减>无公积金
* @Date 19:30 2022/8/1
* @Param type 0 审核通过 1 审核不通过
* @return
......
......@@ -128,13 +128,13 @@ public class TSalaryEmployee extends BaseEntity {
/**
* 开户行省
*/
@ExcelAttribute(name = "开户行省")
@ExcelAttribute(name = "开户行省",isArea = true)
@ExcelProperty("开户行省")
private Integer bankProvince;
/**
* 开户行市
*/
@ExcelAttribute(name = "开户行市")
@ExcelAttribute(name = "开户行市",isArea = true,parentField = "bankProvince")
@ExcelProperty("开户行市")
private Integer bankCity;
/**
......@@ -168,8 +168,8 @@ public class TSalaryEmployee extends BaseEntity {
/**
* 在职状态(0在职;1离职)
*/
@ExcelAttribute(name = "在职状态(0在职;1离职)")
@ExcelProperty("在职状态(0在职;1离职)")
@ExcelAttribute(name = "在职状态",isDataId = true,readConverterExp = "0=在职,1=离职")
@ExcelProperty("在职状态")
private Integer fileStatus;
}
......@@ -342,8 +342,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TSocialFundInfo socialFund;
TDispatchImportVo excel;
EmpDispatchAddVo addVo = new EmpDispatchAddVo();
// 失败项派单
boolean dispatchPart = false;
// 兼职工伤
boolean injury =false;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
dispatchPart = false;
injury= false;
empVo = null;
excel = excelVOList.get(i);
fundSet = fundHoldMap.get(excel.getProvidentHousehold());
......@@ -353,6 +359,23 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(empVoMap)) {
empVo = empVoMap.get(excel.getEmpIdcard());
}
if (Common.isNotNull(socialFund) && Common.isNotNull(socialFund.getSocialId())){
// 部分失败
if (CommonConstants.FOUR_STRING.equals(socialFund.getSocialStatus())){
dispatchPart = true;
}
}
// 自定义 只有工伤数据 视为兼职工伤派单
if (Common.isNotNull(excel) && Common.isNotNull(excel.getSocialHousehold())
&& CommonConstants.ONE_STRING.equals(excel.getPaymentType())){
injury = Common.isEmpty(excel.getPensionStart())
&& Common.isEmpty(excel.getMedicalStart())
&& Common.isEmpty(excel.getBirthStart())
&& Common.isEmpty(excel.getUnemployStart())
&& Common.isEmpty(excel.getBigailmentStart())
&& Common.isNotNull(excel.getWorkInjuryStart())
&& (BigDecimal.ZERO.compareTo(excel.getWorkInjuryCardinal()) <= 0);
}
if (Common.isNotNull(excel.getSocialHousehold())){
if (Common.isEmpty(socialSet)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_HOLD_NOT_EXIST)));
......@@ -373,12 +396,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
continue;
}
// 数据合法情况
if (validImport(errorMessageList, excel,setInfoVo,socialFundMap,empVo,socialSet,fundSet)) {
if (validImport(errorMessageList, excel,setInfoVo,socialFund,empVo,socialSet,fundSet)) {
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
continue;
}
// 是否可以派单: 派单状态、兼职工伤处理
if (validDdispatchStatus(errorMessageList, socialFundMap, excel)) {
if (validDdispatchStatus(errorMessageList, socialFund, excel)) {
excelVOTemp.put(excel.getRowIndex().toString(),excel.getEmpIdcard());
continue;
}
......@@ -392,7 +415,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
continue;
}
// 新增派单信息
initDispatchAddInfo(user, dispatchMap, empVo, socialSet, fundSet, excel,socialFund);
initDispatchAddInfo(user, dispatchMap, empVo, socialSet, fundSet, excel,socialFund,injury);
// 变更社保公积金查询
initSocialFundAddInfo(socialFundAddMap, empVo, socialSet, fundSet, setInfoVo, socialFund, excel);
}
......@@ -401,7 +424,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
addVo.setProjectsMap(projectsMap);
R<EmpDispatchAddVo> res = archivesDaprUtil.addDispatchInfo(addVo);
// 开始插入各种数据了
insertAllInfo(excelVOList, errorMessageList, setInfoVo, res,socialsMap,fundsMap,socialFundAddMap,dispatchMap,excelVOTemp);
insertAllInfo(excelVOList, errorMessageList, setInfoVo, res,socialsMap,fundsMap,socialFundAddMap,dispatchMap,excelVOTemp,dispatchPart);
// 清理map list 等数据
Common.clear(excelVOList);
Common.clear(empAddsMap);
......@@ -436,7 +459,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
Map<String, TProvidentFund> fundsMap,
Map<String, TSocialFundInfo> socialFundAddMap,
Map<String, TDispatchInfo> dispatchMap,
Map<String,String> excelVOTemp) {
Map<String,String> excelVOTemp,
boolean dispatchPart) {
Map<String, EmpAddDispatchVo> empAddsMap = null;
Map<String, EmpContractDispatchVo> contractsMap = null;
Map<String, EmpProjectDispatchVo> projectsMap = null;
......@@ -522,7 +546,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (Common.isNotNull(socialFund) && Common.isNotNull(dispatch)){
socialFund.setDispatchId(dispatch.getId());
}
initSocialFundAndInsert(emp, social, fund, socialFund,project);
initSocialFundAndInsert(emp, social, fund, socialFund,project,dispatchPart);
}
// 生成预付数据
if (Common.isNotNull(socialFund) && Common.isNotNull(socialFund.getId())){
......@@ -611,7 +635,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
TSocialInfo social,
TProvidentFund fund,
TSocialFundInfo socialFund,
EmpProjectDispatchVo project) {
EmpProjectDispatchVo project,
boolean dispatchPart) {
if (Common.isNotNull(socialFund)){
if (Common.isNotNull(project)){
socialFund.setEmpNo(project.getEmpCode());
......@@ -631,11 +656,12 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setFirstBuyMonthSocial(social.getSocialStartDate());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(socialFund.getIsIllness())){
&& CommonConstants.ZERO_STRING.equals(socialFund.getIsIllness())
&& !dispatchPart){
socialFund.setUnitBigailmentMoney(social.getUnitBigailmentMoney());
socialFund.setPersonalBigailmentMoney(social.getPersonalBigailmentMoney());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getPensionHandle())){
if (!CommonConstants.ONE_STRING.equals(socialFund.getPensionHandle()) && !dispatchPart){
socialFund.setUnitPensionCardinal(social.getUnitPensionCardinal());
socialFund.setPersonalPensionCardinal(social.getPersonalPensionCardinal());
socialFund.setUnitPensionPer(social.getUnitPensionPer());
......@@ -644,7 +670,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setPersonalPersionMoney(BigDecimalUtils.safeMultiply(social.getPersonalPensionCardinal(), social.getPersonalPensionPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setPensionHandle(social.getPensionHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getMedicalHandle())){
if (!CommonConstants.ONE_STRING.equals(socialFund.getMedicalHandle()) && !dispatchPart){
socialFund.setUnitMedicalCardinal(social.getUnitMedicalCardinal());
socialFund.setPersonalMedicalCardinal(social.getPersonalMedicalCardinal());
socialFund.setUnitMedicalPer(social.getUnitMedicalPer());
......@@ -653,7 +679,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setPersonalMedicalMoney(BigDecimalUtils.safeMultiply(social.getPersonalMedicalCardinal(), social.getPersonalMedicalPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setMedicalHandle(social.getMedicalHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getUnemployHandle())){
if (!CommonConstants.ONE_STRING.equals(socialFund.getUnemployHandle()) && !dispatchPart){
socialFund.setUnitUnemploymentCardinal(social.getUnitUnemploymentCardinal());
socialFund.setPersonalUnemploymentCardinal(social.getPersonalUnemploymentCardinal());
socialFund.setPersonalUnemploymentPer(social.getPersonalUnemploymentPer());
......@@ -663,7 +689,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setUnemployHandle(social.getUnemployHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(social.getIsIllness())){
&& CommonConstants.ZERO_STRING.equals(social.getIsIllness()) && !dispatchPart){
socialFund.setUnitBigailmentCardinal(social.getUnitBigailmentCardinal());
socialFund.setPersonalBigailmentCardinal(social.getPersonalBigailmentCardinal());
socialFund.setUnitBigailmentPer(social.getUnitBigailmentPer());
......@@ -672,13 +698,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setPersonalBigailmentMoney(social.getPersonalBigailmentMoney());
socialFund.setBigailmentHandle(social.getBigailmentHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getWorkInjuryHandle())){
if (!CommonConstants.ONE_STRING.equals(socialFund.getWorkInjuryHandle()) && !dispatchPart){
socialFund.setUnitWorkInjuryCardinal(social.getUnitWorkInjuryCardinal());
socialFund.setUnitWorkUnjuryPer(social.getUnitWorkUnjuryPer());
socialFund.setUnitInjuryMoney(BigDecimalUtils.safeMultiply(social.getUnitWorkInjuryCardinal(), social.getUnitWorkUnjuryPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
socialFund.setWorkInjuryHandle(social.getWorkInjuryHandle());
}
if (!CommonConstants.ONE_STRING.equals(socialFund.getBirthHandle())){
if (!CommonConstants.ONE_STRING.equals(socialFund.getBirthHandle()) && !dispatchPart){
socialFund.setUnitBirthCardinal(social.getUnitBirthCardinal());
socialFund.setUnitBirthPer(social.getUnitBirthPer());
socialFund.setUnitBirthMoney(BigDecimalUtils.safeMultiply(social.getUnitBirthCardinal(), social.getUnitBirthPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
......@@ -703,12 +729,17 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setRecordBase(social.getRecordBase());
socialFund.setTrustRemark(social.getTrustRemark());
socialFund.setPaymentType(social.getPaymentType());
socialFund.setPensionStart(social.getPensionStart());
socialFund.setMedicalStart(social.getMedicalStart());
socialFund.setUnemployStart(social.getUnemployStart());
socialFund.setWorkInjuryStart(social.getWorkInjuryStart());
socialFund.setBirthStart(social.getBirthStart());
socialFund.setBigailmentStart(social.getBigailmentStart());
// 处理部分失败项派单的 基数 比例 金额,再办理成功的时候才更新过来 顺序不要变 后面有合计
if (!dispatchPart){
socialFund.setPensionStart(social.getPensionStart());
socialFund.setMedicalStart(social.getMedicalStart());
socialFund.setUnemployStart(social.getUnemployStart());
socialFund.setWorkInjuryStart(social.getWorkInjuryStart());
socialFund.setBirthStart(social.getBirthStart());
socialFund.setBigailmentStart(social.getBigailmentStart());
}
socialFund.setUnitSocialSum(BigDecimalUtils.safeAdd(socialFund.getUnitPersionMoney()
, socialFund.getUnitMedicalMoney(), socialFund.getUnitBirthMoney()
......@@ -785,8 +816,6 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setUnitNameFund(setInfoVo.getCustomerName());
socialFund.setSocialStatus(CommonConstants.ZERO_STRING);
socialFund.setSocialAddStatus(CommonConstants.ZERO_STRING);
/*if (!CommonConstants.FOUR_STRING.equals(socialFund.getSocialStatus())){
}*/
socialFund.setSocialReduceStatus(CommonConstants.ONE_STRING_NEGATE);
socialFund.setSocialReduceDate(null);
socialFund.setSocialStartDate(excel.getPensionStart());
......@@ -886,10 +915,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
SysBaseSetInfo socialSet,
SysBaseSetInfo fundSet,
TDispatchImportVo excel,
TSocialFundInfo socialFund) {
TSocialFundInfo socialFund, boolean injury) {
TDispatchInfo dispatch = new TDispatchInfo();
// 初始化派单项
initAddHandleItem(excel, socialFund,dispatch,socialSet);
initAddHandleItem(excel, socialFund,dispatch,socialSet,injury);
dispatch.setOrganName(user.getDeptName());
dispatch.setCreateBy(user.getId());
dispatch.setCreateTime(LocalDateTime.now());
......@@ -968,37 +997,93 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatchMap.put(excel.getEmpIdcard(),dispatch);
}
private void initAddHandleItem(TDispatchImportVo excel, TSocialFundInfo socialFund, TDispatchInfo dispatch, SysBaseSetInfo socialSet) {
private void initAddHandleItem(TDispatchImportVo excel, TSocialFundInfo socialFund, TDispatchInfo dispatch, SysBaseSetInfo socialSet, boolean injury) {
StringBuffer temp = new StringBuffer();
if (Common.isNotNull(socialFund)){
if (Common.isEmpty(socialFund)){
if (Common.isNotNull(excel.getSocialHousehold())){
// 办理失败或已派减 视为可派增
if (CommonConstants.TWO_STRING.equals(socialFund.getPensionHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getPensionHandle())){
if (Common.isNotNull(excel.getPensionStart())){
temp.append(DispatchConstants.DISPATCH_PENSION);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getMedicalHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getMedicalHandle())){
if (Common.isNotNull(excel.getMedicalStart())){
temp.append(DispatchConstants.DISPATCH_MEDICAL);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getWorkInjuryHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getWorkInjuryHandle())){
temp.append(DispatchConstants.DISPATCH_INJURY);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getBirthHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getBirthHandle())){
if (Common.isNotNull(excel.getBirthStart())){
temp.append(DispatchConstants.DISPATCH_BIRTH);
}
if (CommonConstants.TWO_STRING.equals(socialFund.getUnemployHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getUnemployHandle())){
if (Common.isNotNull(excel.getWorkInjuryStart())){
temp.append(DispatchConstants.DISPATCH_INJURY);
}
if (Common.isNotNull(excel.getUnemployStart())){
temp.append(DispatchConstants.DISPATCH_UNEMP);
}
if ((CommonConstants.TWO_STRING.equals(socialFund.getBigailmentHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getBigailmentHandle()))
if (Common.isNotNull(excel.getBigailmentStart())
&& CommonConstants.ZERO_STRING.equals(socialSet.getIsIllness())){
temp.append(DispatchConstants.DISPATCH_BIGMAILMENT);
}
}
if (Common.isNotNull(excel.getProvidentHousehold())){
temp.append(DispatchConstants.DISPATCH_FUND);
}
}
if (Common.isNotNull(socialFund)){
if (Common.isNotNull(excel.getSocialHousehold())){
// 兼职工伤派单只生成兼职工伤派单项
if (injury){
if ((CommonConstants.ZERO_STRING.equals(socialFund.getWorkInjuryHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
||CommonConstants.TWO_STRING.equals(socialFund.getWorkInjuryHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getWorkInjuryHandle())
|| Common.isEmpty(socialFund.getWorkInjuryHandle())){
temp.append(DispatchConstants.DISPATCH_INJURY);
}
// 非兼职工伤派单 所有可派增的项目都再派单项中
}else {
// 办理失败或已派减 视为可派增
if ((CommonConstants.ZERO_STRING.equals(socialFund.getPensionHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
|| CommonConstants.TWO_STRING.equals(socialFund.getPensionHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getPensionHandle())
|| Common.isEmpty(socialFund.getPensionHandle())){
temp.append(DispatchConstants.DISPATCH_PENSION);
}
if ((CommonConstants.ZERO_STRING.equals(socialFund.getMedicalHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
|| CommonConstants.TWO_STRING.equals(socialFund.getMedicalHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getMedicalHandle())
|| Common.isEmpty(socialFund.getMedicalHandle())){
temp.append(DispatchConstants.DISPATCH_MEDICAL);
}
if ((CommonConstants.ZERO_STRING.equals(socialFund.getWorkInjuryHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
||CommonConstants.TWO_STRING.equals(socialFund.getWorkInjuryHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getWorkInjuryHandle())
|| Common.isEmpty(socialFund.getWorkInjuryHandle())){
temp.append(DispatchConstants.DISPATCH_INJURY);
}
if ((CommonConstants.ZERO_STRING.equals(socialFund.getBirthHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
||CommonConstants.TWO_STRING.equals(socialFund.getBirthHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getBirthHandle())
|| Common.isEmpty(socialFund.getBirthHandle())){
temp.append(DispatchConstants.DISPATCH_BIRTH);
}
if ((CommonConstants.ZERO_STRING.equals(socialFund.getUnemployHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
||CommonConstants.TWO_STRING.equals(socialFund.getUnemployHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getUnemployHandle())
|| Common.isEmpty(socialFund.getUnemployHandle())){
temp.append(DispatchConstants.DISPATCH_UNEMP);
}
if (((CommonConstants.ZERO_STRING.equals(socialFund.getBigailmentHandle())
&& CommonConstants.TEN_STRING.equals(socialFund.getSocialStatus()))
|| CommonConstants.TWO_STRING.equals(socialFund.getBigailmentHandle())
|| CommonConstants.THREE_STRING.equals(socialFund.getBigailmentHandle())
|| Common.isEmpty(socialFund.getBigailmentHandle()))
&& CommonConstants.ZERO_STRING.equals(socialSet.getIsIllness())){
temp.append(DispatchConstants.DISPATCH_BIGMAILMENT);
}
}
}
//公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败9 审核不通过)、派减(5待审核 6待办理 7 办理成功 8 办理失败 )
if (Common.isNotNull(excel.getProvidentHousehold())){
temp.append(DispatchConstants.DISPATCH_FUND);
......@@ -1134,8 +1219,10 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
social.setEmpName(empVo.getEmpName());
social.setEmpIdcard(empVo.getEmpIdcard());
social.setEmpNo(empVo.getEmpNo());
}else {
social.setEmpName(excel.getEmpName());
social.setEmpIdcard(excel.getEmpIdcard());
}
social.setEmpIdcard(excel.getEmpIdcard());
social.setBirthHandle(CommonConstants.ZERO_STRING);
social.setMedicalHandle(CommonConstants.ZERO_STRING);
social.setPensionHandle(CommonConstants.ZERO_STRING);
......@@ -1454,8 +1541,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
socialFund.setPersonalBigailmentCardinal(social.getUnitBigailmentCardinal());
socialFund.setPersonalBigailmentPer(social.getUnitBigailmentPer());
}
socialFundMap.put(excel.getEmpIdcard(),socialFund);
}
socialFundMap.put(excel.getEmpIdcard(),socialFund);
}
}
private void initHoldInfo(List<String> socialholds,
......@@ -1614,48 +1701,57 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
empAdds.put(excel.getEmpIdcard(),emp);
}
private boolean validDdispatchStatus(List<ErrorMessage> errorMessageList, Map<String, TSocialFundInfo> socialFundMap,
private boolean validDdispatchStatus(List<ErrorMessage> errorMessageList, TSocialFundInfo sf,
TDispatchImportVo excel) {
TSocialFundInfo sf;
if (Common.isNotNull(socialFundMap)) {
sf = socialFundMap.get(excel.getEmpIdcard());
if (Common.isNotNull(sf) && Common.isNotNull(excel.getSocialHousehold())) {
// 拒绝新增1:派单待审核、派单待办理、办理中、办理成功且未派减成功------ 先排除兼职工伤
if (CommonConstants.ZERO_STRING.equals(sf.getSocialAddStatus())
|| CommonConstants.ONE_STRING.equals(sf.getSocialAddStatus())
|| CommonConstants.SIX_STRING.equals(sf.getSocialAddStatus())
|| (CommonConstants.TWO_STRING.equals(sf.getSocialAddStatus())
&& !CommonConstants.TWO_STRING.equals(sf.getSocialReduceStatus()))
) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_EXISTING)));
if (Common.isNotNull(sf) && Common.isNotNull(excel.getSocialHousehold())) {
// 拒绝新增1:派单待审核、派单待办理、办理中、办理成功且未派减成功------ 先排除兼职工伤
if (CommonConstants.ZERO_STRING.equals(sf.getSocialAddStatus())
|| CommonConstants.ONE_STRING.equals(sf.getSocialAddStatus())
|| CommonConstants.SIX_STRING.equals(sf.getSocialAddStatus())
|| (CommonConstants.TWO_STRING.equals(sf.getSocialAddStatus())
&& !CommonConstants.TWO_STRING.equals(sf.getSocialReduceStatus()))
) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_EXISTING)));
return true;
}
// 拒绝新增2:新增兼职工伤---全部办理失败或全部派减成功才可以派减兼职工伤
boolean flag = Common.isEmpty(excel.getPensionStart())
&& Common.isEmpty(excel.getMedicalStart())
&& Common.isEmpty(excel.getBirthStart())
&& Common.isEmpty(excel.getUnemployStart())
&& Common.isEmpty(excel.getBigailmentStart())
&& Common.isNotNull(excel.getWorkInjuryStart())
&& (BigDecimal.ZERO.compareTo(excel.getWorkInjuryCardinal()) <= 0);
if (flag) {
// 有兼职工伤不可重复增 (未派减成功不可新增兼职工伤)
if ((CommonConstants.ZERO_STRING.equals(sf.getWorkInjuryHandle())
&& !CommonConstants.TEN_STRING.equals(sf.getSocialStatus()))
|| CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_INJURY_EXISTING)));
return true;
}
// 拒绝新增2:新增兼职工伤---全部办理失败或全部派减成功才可以派减兼职工伤
boolean flag = Common.isEmpty(excel.getPensionStart())
&& Common.isEmpty(excel.getMedicalStart())
&& Common.isEmpty(excel.getBirthStart())
&& Common.isEmpty(excel.getUnemployStart())
&& Common.isEmpty(excel.getBigailmentStart())
&& Common.isNotNull(excel.getWorkInjuryStart())
&& (BigDecimal.ZERO.compareTo(excel.getWorkInjuryCardinal()) <= 0);
// 有五险未派减不给新增兼职工伤
flag = CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness()));
if (flag) {
// 有兼职工伤不可重复增 (未派减成功不可新增兼职工伤)
if (CommonConstants.ZERO_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_INJURY_EXISTING)));
return true;
}
// 有五险未派减不给新增兼职工伤
flag = CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness()));
if (flag) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_NOT_REDUCE)));
return true;
}
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_NOT_REDUCE)));
return true;
}
}else {
// 五险派单 如果前面兼职工伤没派减 不可派增
flag = (BigDecimalUtils.safeAdd(sf.getUnitPersionMoney(),sf.getUnitBigailmentMoney(),
sf.getUnitBirthMoney(),sf.getUnitMedicalMoney(),sf.getUnitUnemploymentMoney(),
sf.getUnitInjuryMoney()).compareTo(BigDecimalUtils.isNullToZero(sf.getUnitInjuryMoney())) == 0)
&& !(CommonConstants.TEN_STRING.equals(sf.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.TWO_STRING.equals(sf.getWorkInjuryHandle()));
if (flag) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_INJURY_EXISTING_LIMIT)));
return true;
}
}
}
......@@ -1711,7 +1807,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
private boolean validImport(List<ErrorMessage> errorMessageList,
TDispatchImportVo excel,
ProjectSetInfoVo setInfoVo,
Map<String, TSocialFundInfo> socialFundMap,
TSocialFundInfo socialFund,
DispatchEmpVo empVo, SysBaseSetInfo socialSet, SysBaseSetInfo fundSet) {
if (Common.isEmpty(setInfoVo)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_PROJECT_NOT_FOUND)));
......@@ -1853,34 +1949,30 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return true;
}
TSocialFundInfo socialFund;
if (Common.isNotNull(socialFundMap)){
socialFund = socialFundMap.get(excel.getEmpIdcard());
if (Common.isNotNull(socialFund)){
// 社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败)、派减(6待审核 7待办理 8办理成功 9 办理失败 10 审核不通过-增)
if (Common.isNotNull(excel.getSocialHousehold())
&& (CommonConstants.SIX_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.SEVEN_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.NINE_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.ZERO_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.ONE_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.TWO_STRING.equals(socialFund.getSocialStatus()))
){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_EXISTING)));
return true;
}
// 公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败)、派减(5待审核 6待办理 7 办理成功 8 办理失败 9 审核不通过-增)
if (Common.isNotNull(excel.getProvidentHousehold())
&& (CommonConstants.FIVE_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.SIX_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.EIGHT_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.ZERO_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.ONE_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.THREE_STRING.equals(socialFund.getFundStatus()))){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_EXISTING)));
return true;
}
if (Common.isNotNull(socialFund)){
// 社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败)、派减(6待审核 7待办理 8办理成功 9 办理失败 10 审核不通过-增)
if (Common.isNotNull(excel.getSocialHousehold())
&& (CommonConstants.SIX_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.SEVEN_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.NINE_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.ZERO_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.ONE_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.THREE_STRING.equals(socialFund.getSocialStatus())
|| CommonConstants.TWO_STRING.equals(socialFund.getSocialStatus()))
){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_EXISTING)));
return true;
}
// 公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败)、派减(5待审核 6待办理 7 办理成功 8 办理失败 9 审核不通过-增)
if (Common.isNotNull(excel.getProvidentHousehold())
&& (CommonConstants.FIVE_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.SIX_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.EIGHT_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.ZERO_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.ONE_STRING.equals(socialFund.getFundStatus())
|| CommonConstants.THREE_STRING.equals(socialFund.getFundStatus()))){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_FUND_EXISTING)));
return true;
}
}
if (Common.isNotNull(excel.getSocialHousehold())){
......@@ -2654,6 +2746,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())))
&& !(CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
&& CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
&& CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
&& CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
&& CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
&& (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())));
if (flagTemp){
sf.setSocialStatus(CommonConstants.FOUR_STRING);
......@@ -2863,13 +2962,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_SUCCESS);
initAuditInfo(auditInfo, ( temp + handleRemark), CommonConstants.THREE_STRING, user, temp.toString(), remark);
initAuditInfo(auditInfo, ( temp + ServiceUtil.ifNullToEmpty(handleRemark)), CommonConstants.THREE_STRING, user, temp.toString(), remark);
} else {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_ADD);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
initAuditInfo(auditInfo, ( temp + handleRemark), CommonConstants.FOUR_STRING, user, temp.toString(), remark);
initAuditInfo(auditInfo, ( temp + ServiceUtil.ifNullToEmpty(handleRemark)), CommonConstants.FOUR_STRING, user, temp.toString(), remark);
}
auditInfo.setSocialId(dis.getId());
} else {
......@@ -2945,14 +3044,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_SUCCESS);
temp.append(handleRemark);
temp.append(ServiceUtil.ifNullToEmpty(handleRemark));
initAuditInfo(auditInfo,temp.toString(), CommonConstants.THREE_STRING, user, temp.toString(), remark);
} else {
temp.setLength(CommonConstants.ZERO_INT);
temp.append(DispatchConstants.DISPATCH_SOCIAL_REDUCE);
temp.append(Common.isNullToString(socialTypeRemark));
temp.append(DispatchConstants.DISPATCH_HANDLE_FAIL);
temp.append(handleRemark);
temp.append(ServiceUtil.ifNullToEmpty(handleRemark));
initAuditInfo(auditInfo,temp.toString(), CommonConstants.FOUR_STRING, user, temp.toString(), remark);
}
dis.setSocialHandleStatus(handleStatus);
......@@ -3058,24 +3157,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
auditInfo.setEmpIdcard(dis.getEmpIdcard());
auditInfoMapper.insert(auditInfo);
baseMapper.updateById(dis);
// 派增办理失败 失败项重新派单办理失败 恢复为部分办理失败
boolean flagTemp = Common.isNotNull(sf) && Common.isNotNull(dis.getSocialId())
&& (CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())));
if (flagTemp){
sf.setSocialStatus(CommonConstants.FOUR_STRING);
sf.setSocialAddStatus(CommonConstants.THREE_STRING);
}
socialFundMapper.updateById(sf);
//1.派增办理失败 刷新预估数据
if (CommonConstants.ZERO_STRING.equals(dis.getType())) {
// 办理失败
if (CommonConstants.ONE_INT == flag){
if (CommonConstants.ONE_INT == flag && CommonConstants.FIVE_STRING.equals(sf.getSocialStatus())){
// 派增办理,全部失败 同步预估库数据
forecastLibraryService.updateForecastLibaryByDispatchReduce(sf, forecastFlag);
}
......@@ -3132,46 +3218,62 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
return forecastFlag;
}
/**
* @Author fxj
* @Description 派增:
* * 1、派单处社保或公积金状态为待审核、待办理、办理中,项目档案处社保或公积金状态为处理中1;
* * 2、派单处社保或公积金状态为审核不通过或办理失败,项目档案处社保状态为无社保,公积金状态为无公积金0;
* * 3、派单处社保状态为部分办理失败,项目档案处社保状态为部分购买 2
* * 4、派单处社保或公积金状态为办理成功,项目档案处社保或公积金状态为正常 3
* * 派减:
* * 1、派减状态为待审核、待办理、审核不通过、办理失败,项目档案处社保或公积金状态不变;
* * 2、派减状态为办理成功,项目档案处社保或公积金状态变为已派减 4
* * 人员档案处社保或公积金状态根据身份证+项目进行整合:
* * 社保状态优先级:正常>部分购买>处理中>已派减>无社保
* * 公积金状态优先级:正常>处理中>已派减>无公积金
* @Date 15:18 2022/8/9
* @Param
* @return
**/
private void initSocialFundStatus(TSocialInfo socialInfo, TProvidentFund providentFund, UpProjectSocialFundVo vo, TSocialFundInfo sf) {
if (Common.isNotNull(socialInfo)){
// 办理失败或审核不通过
if (CommonConstants.TWO_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.TWO_STRING.equals(socialInfo.getAuditStatus())){
// 办理失败或审核不通过且无办理成功项
if (CommonConstants.FIVE_STRING.equals(sf.getSocialStatus())
|| (CommonConstants.TEN_STRING.equals(sf.getSocialStatus())
&& !CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
&& !CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
&& !(CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())))
){
vo.setSocialStatus(CommonConstants.ZERO_STRING);
}
// 待办理或办理中 处理中
if (CommonConstants.ZERO_STRING.equals(socialInfo.getHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus())){
// 待办理或办理中或部分办理失败或审核不通过部分办理成功 处理中
if (CommonConstants.ZERO_STRING.equals(sf.getSocialStatus())
|| CommonConstants.TWO_STRING.equals(sf.getSocialStatus())){
vo.setSocialStatus(CommonConstants.ONE_STRING);
}
if (CommonConstants.FIVE_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.TWO_STRING);
}
if (CommonConstants.ONE_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.THREE_STRING);
}
if (CommonConstants.THREE_STRING.equals(socialInfo.getHandleStatus())){
vo.setSocialStatus(CommonConstants.FOUR_STRING);
}
boolean flag = (CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
// 部分办理失败或审核不通过部分办理成功
if (CommonConstants.FOUR_STRING.equals(sf.getSocialStatus())
|| (CommonConstants.TEN_STRING.equals(sf.getSocialStatus())
&& (CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())))
&&
(!CommonConstants.ONE_STRING.equals(sf.getPensionHandle())
|| !CommonConstants.ONE_STRING.equals(sf.getMedicalHandle())
|| !CommonConstants.ONE_STRING.equals(sf.getBirthHandle())
|| !CommonConstants.ONE_STRING.equals(sf.getWorkInjuryHandle())
|| !CommonConstants.ONE_STRING.equals(sf.getUnemployHandle())
|| (!CommonConstants.ONE_STRING.equals(sf.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness())));
if (flag){
&& CommonConstants.ZERO_STRING.equals(sf.getIsIllness()))
))){
vo.setSocialStatus(CommonConstants.TWO_STRING);
}
if (CommonConstants.THREE_STRING.equals(sf.getSocialStatus())){
vo.setSocialStatus(CommonConstants.THREE_STRING);
}
if (CommonConstants.EIGHT_STRING.equals(sf.getSocialStatus())){
vo.setSocialStatus(CommonConstants.FOUR_STRING);
}
}
// 公积金状态 社保状态(字典): 0 无社保 1 处理中 2.正常 3.已派减
if (Common.isNotNull(providentFund)){
......@@ -3242,6 +3344,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
**/
private void setSocialHandleStatus(String handleStatus, String socialType, int flag, TSocialInfo socialInfo
, TDispatchInfo dis, TSocialFundInfo sf) {
// 办理成功 处理社保相关数据 (直接排除五险)
updateSocialByHandle(flag, socialInfo, dis, sf);
// 批量办理,或者办理选择对应的类型,修改对应的办理状态
this.setSocialSixStatus(handleStatus, socialType, socialInfo,sf);
......@@ -3329,6 +3433,84 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
}
}
}
private void updateSocialByHandle(int flag, TSocialInfo socialInfo, TDispatchInfo dis, TSocialFundInfo sf) {
if (CommonConstants.ZERO_INT== flag
&& CommonConstants.ZERO_STRING.equals(dis.getType())
&& Common.isNotNull(dis.getSocialId())){
if (CommonConstants.ZERO_STRING.equals(socialInfo.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getIsIllness())){
sf.setUnitBigailmentMoney(socialInfo.getUnitBigailmentMoney());
sf.setPersonalBigailmentMoney(socialInfo.getPersonalBigailmentMoney());
}
if (!CommonConstants.ZERO_STRING.equals(socialInfo.getPensionHandle())){
sf.setUnitPensionCardinal(socialInfo.getUnitPensionCardinal());
sf.setPersonalPensionCardinal(socialInfo.getPersonalPensionCardinal());
sf.setUnitPensionPer(socialInfo.getUnitPensionPer());
sf.setPersonalPensionPer(socialInfo.getPersonalPensionPer());
sf.setUnitPersionMoney(BigDecimalUtils.safeMultiply(socialInfo.getUnitPensionCardinal(), socialInfo.getUnitPensionPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setPersonalPersionMoney(BigDecimalUtils.safeMultiply(socialInfo.getPersonalPensionCardinal(), socialInfo.getPersonalPensionPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setPensionHandle(socialInfo.getPensionHandle());
sf.setPensionStart(socialInfo.getPensionStart());
}
if (!CommonConstants.ZERO_STRING.equals(socialInfo.getMedicalHandle())){
sf.setUnitMedicalCardinal(socialInfo.getUnitMedicalCardinal());
sf.setPersonalMedicalCardinal(socialInfo.getPersonalMedicalCardinal());
sf.setUnitMedicalPer(socialInfo.getUnitMedicalPer());
sf.setPersonalMedicalPer(socialInfo.getPersonalMedicalPer());
sf.setUnitMedicalMoney(BigDecimalUtils.safeMultiply(socialInfo.getUnitMedicalCardinal(), socialInfo.getUnitMedicalPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setPersonalMedicalMoney(BigDecimalUtils.safeMultiply(socialInfo.getPersonalMedicalCardinal(), socialInfo.getPersonalMedicalPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setMedicalHandle(socialInfo.getMedicalHandle());
sf.setMedicalStart(socialInfo.getMedicalStart());
}
if (!CommonConstants.ZERO_STRING.equals(socialInfo.getUnemployHandle())){
sf.setUnitUnemploymentCardinal(socialInfo.getUnitUnemploymentCardinal());
sf.setPersonalUnemploymentCardinal(socialInfo.getPersonalUnemploymentCardinal());
sf.setPersonalUnemploymentPer(socialInfo.getPersonalUnemploymentPer());
sf.setUnitUnemploymentPer(socialInfo.getUnitUnemploymentPer());
sf.setUnitUnemploymentMoney(BigDecimalUtils.safeMultiply(socialInfo.getUnitUnemploymentCardinal(), socialInfo.getUnitUnemploymentPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setPersonalUnemploymentMoney(BigDecimalUtils.safeMultiply(socialInfo.getPersonalUnemploymentCardinal(), socialInfo.getPersonalUnemploymentPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setUnemployHandle(socialInfo.getUnemployHandle());
sf.setUnemployStart(socialInfo.getUnemployStart());
}
if (!CommonConstants.ZERO_STRING.equals(socialInfo.getBigailmentHandle())
&& CommonConstants.ZERO_STRING.equals(socialInfo.getIsIllness())){
sf.setUnitBigailmentCardinal(socialInfo.getUnitBigailmentCardinal());
sf.setPersonalBigailmentCardinal(socialInfo.getPersonalBigailmentCardinal());
sf.setUnitBigailmentPer(socialInfo.getUnitBigailmentPer());
sf.setPersonalBigailmentPer(socialInfo.getPersonalBigailmentPer());
sf.setUnitBigailmentMoney(socialInfo.getUnitBigailmentMoney());
sf.setPersonalBigailmentMoney(socialInfo.getPersonalBigailmentMoney());
sf.setBigailmentHandle(socialInfo.getBigailmentHandle());
sf.setBigailmentStart(socialInfo.getBigailmentStart());
}
if (!CommonConstants.ZERO_STRING.equals(socialInfo.getWorkInjuryHandle())){
sf.setUnitWorkInjuryCardinal(socialInfo.getUnitWorkInjuryCardinal());
sf.setUnitWorkUnjuryPer(socialInfo.getUnitWorkUnjuryPer());
sf.setUnitInjuryMoney(BigDecimalUtils.safeMultiply(socialInfo.getUnitWorkInjuryCardinal(), socialInfo.getUnitWorkUnjuryPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setWorkInjuryHandle(socialInfo.getWorkInjuryHandle());
sf.setWorkInjuryStart(socialInfo.getWorkInjuryStart());
}
if (!CommonConstants.ZERO_STRING.equals(socialInfo.getBirthHandle())){
sf.setUnitBirthCardinal(socialInfo.getUnitBirthCardinal());
sf.setUnitBirthPer(socialInfo.getUnitBirthPer());
sf.setUnitBirthMoney(BigDecimalUtils.safeMultiply(socialInfo.getUnitBirthCardinal(), socialInfo.getUnitBirthPer(),BigDecimal.valueOf(CommonConstants.ONE_OF_PERCENT.doubleValue())));
sf.setBirthHandle(socialInfo.getBirthHandle());
sf.setBirthStart(socialInfo.getBirthStart());
}
sf.setUnitSocialSum(BigDecimalUtils.safeAdd(sf.getUnitPersionMoney()
, sf.getUnitMedicalMoney(), sf.getUnitBirthMoney()
, sf.getUnitInjuryMoney()
, sf.getUnitUnemploymentMoney()
, sf.getUnitBigailmentMoney()));
sf.setPersonalSocialSum(BigDecimalUtils.safeAdd(sf.getPersonalBigailmentMoney()
, sf.getPersonalPersionMoney()
, sf.getPersonalMedicalMoney()
, sf.getPersonalUnemploymentMoney()));
}
}
/**
* @Author fxj
* @Description if flag=obj return value1 else return value2
......
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