Commit 1efdfcd4 authored by fangxinjiang's avatar fangxinjiang

批量办理 100%

parent 26b38197
...@@ -2167,6 +2167,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T ...@@ -2167,6 +2167,7 @@ public class TEmployeeInfoServiceImpl extends ServiceImpl<TEmployeeInfoMapper, T
contract.setAuditStatus(CommonConstants.ONE_INT); contract.setAuditStatus(CommonConstants.ONE_INT);
contract.setApplyNo(contractServicer.getCode(false)); contract.setApplyNo(contractServicer.getCode(false));
contract.setInUse(CommonConstants.ONE_STRING); contract.setInUse(CommonConstants.ONE_STRING);
contract.setIsObsolete(CommonConstants.ZERO_ONE);
contractServicer.save(contract); contractServicer.save(contract);
contractAdd.setId(contract.getId()); contractAdd.setId(contract.getId());
contractAdd.setEmpNo(contract.getEmpNo()); contractAdd.setEmpNo(contract.getEmpNo());
......
...@@ -716,17 +716,26 @@ ...@@ -716,17 +716,26 @@
x.CONTRACT_END, x.CONTRACT_END,
x.CONTRACT_TERM, x.CONTRACT_TERM,
x.CONTRACT_SUB_NAME, x.CONTRACT_SUB_NAME,
x.ID as "CONTRACT_ID" x.ID as "CONTRACT_ID",
x.EMP_IDCARD
FROM FROM
t_employee_contract_info x t_employee_contract_info x
WHERE WHERE
x.DELETE_FLAG = '0' x.DELETE_FLAG = '0'
AND x.AUDIT_STATUS = '2' AND x.AUDIT_STATUS != '3'
AND x.IS_OBSOLETE = '0' AND x.IS_OBSOLETE = '0'
AND x.IN_USE = '0' AND x.IN_USE = '0'
<if test="checkVo != null">
<if test="checkVo.idCards != null">
AND x.EMP_IDCARD in
<foreach item="idStr" index="index" collection="checkVo.idCards" open="(" separator="," close=")">
#{idStr}
</foreach>
</if>
</if>
GROUP BY GROUP BY
x.SETTLE_DOMAIN x.SETTLE_DOMAIN,x.EMP_IDCARD
) b on c.DEPT_ID= b.SETTLE_DOMAIN ) b on c.DEPT_ID= b.SETTLE_DOMAIN and b.EMP_IDCARD=a.EMP_IDCARD
</select> </select>
......
...@@ -468,4 +468,12 @@ public interface ErrorCodes { ...@@ -468,4 +468,12 @@ public interface ErrorCodes {
* 派增异常: 对应项目编码已停止合作 * 派增异常: 对应项目编码已停止合作
*/ */
String EMP_DISPATCH_SETTLEDOMAIN_STOP = "emp.dispatch.settleDomain.stop"; String EMP_DISPATCH_SETTLEDOMAIN_STOP = "emp.dispatch.settleDomain.stop";
/**
* 派减异常: 无对应项目编码的社保信息
*/
String EMP_DISPATCH_REDUCE_SOCIAL_DEPARTNO_ERROR = "emp.dispatch.reduce.social.depart.no.error";
/**
* 派减异常: 无对应项目编码的公积金信息
*/
String EMP_DISPATCH_REDUCE_FUND_DEPARTNO_ERROR = "emp.dispatch.reduce.fund.depart.no.error";
} }
...@@ -177,6 +177,10 @@ emp.dispatch.emp.not.empty=\u6D3E\u589E\u5F02\u5E38\uFF1A \u7CFB\u7EDF\u65E0\u5B ...@@ -177,6 +177,10 @@ emp.dispatch.emp.not.empty=\u6D3E\u589E\u5F02\u5E38\uFF1A \u7CFB\u7EDF\u65E0\u5B
emp.dispatch.settleDomain.stop=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u5DF2\u505C\u6B62\u5408\u4F5C emp.dispatch.settleDomain.stop=\u6D3E\u589E\u5F02\u5E38\uFF1A \u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u5DF2\u505C\u6B62\u5408\u4F5C
emp.dispatch.reduce.social.depart.no.error=\u6D3E\u51CF\u5F02\u5E38\uFF1A \u65E0\u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u7684\u793E\u4FDD\u4FE1\u606F
emp.dispatch.reduce.fund.depart.no.error=\u6D3E\u51CF\u5F02\u5E38\uFF1A \u65E0\u5BF9\u5E94\u9879\u76EE\u7F16\u7801\u7684\u516C\u79EF\u91D1\u4FE1\u606F
......
...@@ -40,6 +40,13 @@ import java.util.Date; ...@@ -40,6 +40,13 @@ import java.util.Date;
@Data @Data
public class TDispatchReduceVo extends RowIndex implements Serializable { public class TDispatchReduceVo extends RowIndex implements Serializable {
/**
* 项目编码
*/
@ExcelAttribute(name = "项目编码", maxLength = 50, isNotEmpty = true)
@Schema(description = "项目编码" )
@ExcelProperty("项目编码" )
private String departNo;
/** /**
* 员工姓名 * 员工姓名
*/ */
......
...@@ -340,7 +340,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -340,7 +340,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
fundSet = fundHoldMap.get(excel.getProvidentHousehold()); fundSet = fundHoldMap.get(excel.getProvidentHousehold());
socialSet = socialHoldMap.get(excel.getSocialHousehold()); socialSet = socialHoldMap.get(excel.getSocialHousehold());
socialFund = getSocialFund(socialFundMap,excel); socialFund = getSocialFund(socialFundMap,excel);
setInfoVo = getSetInfoVo(projectVoMap,excel); setInfoVo = getSetInfoVo(projectVoMap,excel.getSettleDomainCode());
if (Common.isNotNull(empVoMap)) { if (Common.isNotNull(empVoMap)) {
empVo = empVoMap.get(excel.getEmpIdcard()); empVo = empVoMap.get(excel.getEmpIdcard());
} }
...@@ -406,8 +406,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -406,8 +406,8 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
Common.clear(fundHoldMap); Common.clear(fundHoldMap);
Common.clear(excelVOTemp); Common.clear(excelVOTemp);
} }
private ProjectSetInfoVo getSetInfoVo(Map<String, ProjectSetInfoVo> projectVoMap, TDispatchImportVo excel) { private ProjectSetInfoVo getSetInfoVo(Map<String, ProjectSetInfoVo> projectVoMap, String code) {
return Common.isEmpty(projectVoMap)?null:projectVoMap.get(excel.getSettleDomainCode()); return Common.isEmpty(projectVoMap)?null:projectVoMap.get(code);
} }
private TSocialFundInfo getSocialFund(Map<String, TSocialFundInfo> socialFundMap, TDispatchImportVo excel) { private TSocialFundInfo getSocialFund(Map<String, TSocialFundInfo> socialFundMap, TDispatchImportVo excel) {
...@@ -1985,20 +1985,29 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -1985,20 +1985,29 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
Map<String,String> excelVOTemp = new HashMap<>(); Map<String,String> excelVOTemp = new HashMap<>();
// 个性化校验逻辑 // 个性化校验逻辑
List<String> idcards = new ArrayList<>(); List<String> idcards = new ArrayList<>();
// 通过身份证和项目编码获取档案&项目档案&最新合同 List<String> codes = new ArrayList<>();
Map<String, DispatchEmpVo> empVoMap = getDispatchEmpVo(idcards, null);
// 初始化参数 // 初始化参数
initIdcard(excelVOList, idcards); initIdcard(excelVOList, idcards,codes);
// 通过身份证和项目编码获取档案&项目档案&最新合同
Map<String, DispatchEmpVo> empVoMap = getDispatchEmpVo(idcards, codes);
// 通过身份证查询社保&公积金&社保公积金查询信息: 身份证维度唯一 // 通过身份证查询社保&公积金&社保公积金查询信息: 身份证维度唯一
Map<String, TSocialFundInfo> socialFundMap = getSocialFundMap(idcards); Map<String, TSocialFundInfo> socialFundMap = getSocialFundMap(idcards);
// 获取项目编码数据 以供校验
Map<String, ProjectSetInfoVo> projectVoMap = getProjectVoMap(codes);
DispatchEmpVo empVo = null; DispatchEmpVo empVo = null;
TDispatchInfo dispatch; TDispatchInfo dispatch;
TDispatchReduceVo excel; TDispatchReduceVo excel;
TSocialFundInfo socialFund; TSocialFundInfo socialFund;
ProjectSetInfoVo setInfoVo = null;
// 执行数据插入操作 组装 // 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) { for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i); excel = excelVOList.get(i);
setInfoVo = getSetInfoVo(projectVoMap,excel.getDepartNo());
socialFund = socialFundMap.get(excel.getEmpIdcard()); socialFund = socialFundMap.get(excel.getEmpIdcard());
if (Common.isEmpty(setInfoVo)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_PROJECT_NOT_FOUND)));
continue;
}
if (Common.isEmpty(socialFund)){ if (Common.isEmpty(socialFund)){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_FUND_NOT_EMPTY))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_FUND_NOT_EMPTY)));
continue; continue;
...@@ -2012,8 +2021,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2012,8 +2021,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard()); excelVOTemp.put(excel.getEmpIdcard(),excel.getEmpIdcard());
// 初始化派单 和 社保公积金查询信息 // 初始化派单 和 社保公积金查询信息
dispatch = gettDispatchInfo(empVo, excel, socialFund); dispatch = gettDispatchInfo(empVo, excel, socialFund,setInfoVo);
try { try {
dispatch.setApplyNo(getApplyCode());
dispatch.setStatus(CommonConstants.ONE_STRING); dispatch.setStatus(CommonConstants.ONE_STRING);
baseMapper.insert(dispatch); baseMapper.insert(dispatch);
socialFundMapper.updateById(socialFund); socialFundMapper.updateById(socialFund);
...@@ -2026,7 +2036,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2026,7 +2036,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
} }
private TDispatchInfo gettDispatchInfo(DispatchEmpVo empVo, TDispatchReduceVo excel, TSocialFundInfo socialFund) { private TDispatchInfo gettDispatchInfo(DispatchEmpVo empVo, TDispatchReduceVo excel, TSocialFundInfo socialFund, ProjectSetInfoVo setInfoVo) {
TDispatchInfo dispatch; TDispatchInfo dispatch;
dispatch = new TDispatchInfo(); dispatch = new TDispatchInfo();
dispatch.setEmpId(socialFund.getEmpId()); dispatch.setEmpId(socialFund.getEmpId());
...@@ -2039,6 +2049,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2039,6 +2049,13 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setDeleteFlag(CommonConstants.ZERO_STRING); dispatch.setDeleteFlag(CommonConstants.ZERO_STRING);
dispatch.setReduceReason(excel.getReasonType()); dispatch.setReduceReason(excel.getReasonType());
dispatch.setTrustRemark(excel.getTrustRemark()); dispatch.setTrustRemark(excel.getTrustRemark());
if (Common.isNotNull(setInfoVo)){
dispatch.setSettleDomain(setInfoVo.getId());
dispatch.setSettleDomainName(setInfoVo.getDepartName());
dispatch.setSettleDomainCode(setInfoVo.getDepartNo());
dispatch.setBelongUnit(setInfoVo.getCustomerId());
dispatch.setBelongUnitName(setInfoVo.getCustomerName());
}
StringBuffer temp = new StringBuffer(); StringBuffer temp = new StringBuffer();
if (Common.isNotNull(excel.getSocialReduceDate())){ if (Common.isNotNull(excel.getSocialReduceDate())){
dispatch.setSocialHandleStatus(CommonConstants.ZERO_STRING); dispatch.setSocialHandleStatus(CommonConstants.ZERO_STRING);
...@@ -2095,7 +2112,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2095,7 +2112,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
dispatch.setEmpMobile(empVo.getEmpPhone()); dispatch.setEmpMobile(empVo.getEmpPhone());
dispatch.setEmpNational(empVo.getEmpNational()); dispatch.setEmpNational(empVo.getEmpNational());
dispatch.setEmpId(empVo.getId()); dispatch.setEmpId(empVo.getId());
dispatch.setEmpNo(empVo.getEmpCode()); dispatch.setEmpNo(empVo.getEmpNo());
// 封装合同信息 如果有合同取值实际合同信息 // 封装合同信息 如果有合同取值实际合同信息
dispatch.setContractStart(empVo.getContractStart()); dispatch.setContractStart(empVo.getContractStart());
dispatch.setContractEnd(empVo.getContractEnd()); dispatch.setContractEnd(empVo.getContractEnd());
...@@ -2125,25 +2142,40 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2125,25 +2142,40 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_FUND_NOT_EMPTY))); errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_SOCIAL_FUND_NOT_EMPTY)));
return true; return true;
} }
// 项目编码校验
//社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败)、派减(6待审核 7待办理 8办理成功 9 办理失败) //社保状态:派增(0待审核、1待办理、2办理中 3办理成功、4部分办理失败 5 办理失败)、派减(6待审核 7待办理 8办理成功 9 办理失败)
if (Common.isNotNull(excel.getSocialReduceDate()) if (Common.isNotNull(excel.getSocialReduceDate())){
&& !socialFund.getSocialStatus().equals(CommonConstants.THREE_STRING)){ if (!socialFund.getSocialStatus().equals(CommonConstants.THREE_STRING)
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_REDUCE_SOCIAL_STATUS_ERROR))); && !socialFund.getSocialStatus().equals(CommonConstants.NINE_STRING)){
return true; errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_REDUCE_SOCIAL_STATUS_ERROR)));
return true;
}
if (!excel.getDepartNo().equals(socialFund.getSettleDomainCode())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_REDUCE_SOCIAL_DEPARTNO_ERROR)));
return true;
}
} }
//公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败)、派减(5待审核 6待办理 7 办理成功 8 办理失败) //公积金状态:派增(0待审核、1待办理、3办理成功、4办理失败)、派减(5待审核 6待办理 7 办理成功 8 办理失败)
if (Common.isNotNull(excel.getFundReduceDate()) if (Common.isNotNull(excel.getFundReduceDate())){
&& !socialFund.getFundStatus().equals(CommonConstants.THREE_STRING)){ if (!socialFund.getFundStatus().equals(CommonConstants.THREE_STRING)
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_REDUCE_FUND_STATUS_ERROR))); && !socialFund.getFundStatus().equals(CommonConstants.EIGHT_STRING)){
return true; errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_REDUCE_FUND_STATUS_ERROR)));
return true;
}
if (!excel.getDepartNo().equals(socialFund.getSettleDomainCodeFund())){
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), MsgUtils.getMessage(ErrorCodes.EMP_DISPATCH_REDUCE_FUND_DEPARTNO_ERROR)));
return true;
}
} }
return false; return false;
} }
private void initIdcard(List<TDispatchReduceVo> excelVOList, List<String> idcards) { private void initIdcard(List<TDispatchReduceVo> excelVOList, List<String> idcards, List<String> codes) {
if (Common.isNotNull(excelVOList)) { if (Common.isNotNull(excelVOList)) {
for (TDispatchReduceVo vo : excelVOList) { for (TDispatchReduceVo vo : excelVOList) {
idcards.add(vo.getEmpIdcard()); idcards.add(vo.getEmpIdcard());
codes.add(vo.getDepartNo());
} }
} }
} }
...@@ -2360,6 +2392,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2360,6 +2392,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (CommonConstants.dingleDigitStrArray[1].equals(dis.getType())){ if (CommonConstants.dingleDigitStrArray[1].equals(dis.getType())){
// 审核通过 // 审核通过
if (CommonConstants.ZERO_INT == flag.intValue()) { if (CommonConstants.ZERO_INT == flag.intValue()) {
providentFund.setReduceCan(CommonConstants.ONE_STRING);
sf.setFundReduceStatus(CommonConstants.ONE_STRING); sf.setFundReduceStatus(CommonConstants.ONE_STRING);
sf.setFundStatus(CommonConstants.EIGHT_STRING); sf.setFundStatus(CommonConstants.EIGHT_STRING);
// 审核不通过 // 审核不通过
...@@ -2762,14 +2795,25 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -2762,14 +2795,25 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
} }
//派减判断 //派减判断
} else if (CommonConstants.ONE_STRING.equals(dis.getType())) { } else if (CommonConstants.ONE_STRING.equals(dis.getType())) {
if ( !((Common.isNotNull(socialInfo) if (Common.isNotNull(dis.getSocialHandleStatus())
&& (CommonConstants.ZERO_STRING.equals(socialInfo.getHandleStatus()) && Common.isNotNull(dis.getFundHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getHandleStatus()))) && (CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| (Common.isEmpty(providentFund) || CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus()))
&& (Common.isEmpty(providentFund) && ((CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.ZERO_STRING.equals(providentFund.getHandleStatus())))) || CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus())))) {
) { //办理成功
//办理成功或失败 更新为办理完结 2020-05-26 dis.setStatus(CommonConstants.FOUR_STRING);
}
if (Common.isEmpty(dis.getSocialHandleStatus())
&& ((CommonConstants.ONE_STRING.equals(dis.getFundHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getFundHandleStatus())))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING);
}
if ((Common.isEmpty(dis.getFundHandleStatus())
&& CommonConstants.ONE_STRING.equals(dis.getSocialHandleStatus())
|| CommonConstants.TWO_STRING.equals(dis.getSocialHandleStatus()))) {
//办理成功
dis.setStatus(CommonConstants.FOUR_STRING); dis.setStatus(CommonConstants.FOUR_STRING);
} }
} }
......
...@@ -401,8 +401,8 @@ ...@@ -401,8 +401,8 @@
AND f.PROVIDENT_HOUSEHOLD_NAME = #{tDispatchInfo.providentHouseholdName} AND f.PROVIDENT_HOUSEHOLD_NAME = #{tDispatchInfo.providentHouseholdName}
</if> </if>
<if test="tDispatchInfo.createTimes != null and tDispatchInfo.createTimes.length>0"> <if test="tDispatchInfo.createTimes != null and tDispatchInfo.createTimes.length>0">
AND a.UPDATE_TIME <![CDATA[ >= ]]> #{tDispatchInfo.createTimes[0]} AND a.CREATE_TIME <![CDATA[ >= ]]> #{tDispatchInfo.createTimes[0]}
AND a.UPDATE_TIME <![CDATA[ <= ]]> #{tDispatchInfo.createTimes[1]} AND a.CREATE_TIME <![CDATA[ <= ]]> #{tDispatchInfo.createTimes[1]}
</if> </if>
</if> </if>
</sql> </sql>
......
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