Commit 06e7c9e0 authored by huyuchen's avatar huyuchen

预派单 代码修改

parent 62bd642f
......@@ -16,12 +16,14 @@
*/
package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;
/**
* 缴费库
......@@ -32,28 +34,31 @@ import java.util.List;
@Data
public class TPaymentInfoSearchVo extends TPaymentInfo {
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,id数组")
private List<String> idList;
@Schema(description = "导出的表头的Set")
private Set<String> exportFields;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
/**
* 多选导出或删除等操作
*/
@Schema(description = "选中ID,id数组")
private List<String> idList;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema(description = "创建时间区间")
private LocalDateTime[] createTimes;
/**
* @Author fxj
* 查询数据起
**/
@Schema(description = "查询limit 开始")
private int limitStart;
/**
* @Author fxj
* 查询数据止
**/
@Schema(description = "查询limit 数据条数")
private int limitEnd;
}
......@@ -6,8 +6,6 @@ public class PreDispatchConstants {
public static final String NO_PENSION_AREA_REDUCE = "获取缴纳地数据失败,请检查养老截止城市或公积金截止城市名称是否合规!";
public static final String NO_PENSION_AREA= "请检查派单缴纳地名称是否合规!";
public static final String SOCIAL_START_DATE_ERROR = "社保起缴月份在可补缴月份之前,请确认后操作!";
public static final String NO_SOCIAL_BASE_SET_INFO = "未找到有效的社保基数配置信息(户+缴纳地+起缴时间)!";
......@@ -27,7 +25,6 @@ public class PreDispatchConstants {
"工伤城市","工伤截止时间","生育城市","生育截止时间","失业城市","失业截止时间","公积金城市","公积金截止时间",
"派单分公司","派单客服","小合同名称","合同类型"};
public static final String HAED_ERROR = "请使用标准模板!";
public static final String POSITION = "服务";
public static final String CONTRACT_NAME = "代理社保";
public static final String DISPATCH_TYPE_ERROR = "派单类型有误,0-派增 1-派减!";
......@@ -40,16 +37,10 @@ public class PreDispatchConstants {
public static final String PRESTATUS_ERROR = "‘是否派单’为是且‘预派单状态’为正常未派单才可派单!";
public static final String CITY = "city";
public static final String TOWN = "town";
public static final String SOCIAL_CITY = "social_city";
public static final String SOCIAL_TOWN = "social_town";
public static final String FUND_CITY = "fund_city";
public static final String FUND_TOWN = "fund_town";
public static final String YES_CH = "是";
public static final String NO_CH = "否";
public static final String DATA_CHECK = "数据校验信息:";
public static final String DATA_HANDLE_RESULT = "数据导入结果:";
public static final String DATA_IMPORT_ANALYSIS_ERROR = "数据导入解析失败!";
public static final String IMPORT_PREDISPATCH = "导出预派单";
public static final String NO_SOCIAL_FUND_ADDRESS_ADD = "派增:养老城市和公积金城市不可同时为空,请确认表中有‘养老城市’和‘公积金城市’数据列及数据!";
public static final String NO_SOCIAL_FUND_ADDRESS_REDUCE = "派减:养老城市和公积金城市不可同时为空,请确认表中有‘养老城市’和‘公积金城市’数据列及数据!";
public static final String TEL_NOT_EMPTY = "联系电话1不可为空!";
......
......@@ -94,7 +94,6 @@ public class TPreDispatchInfoController {
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('social_tpredispatchinfo_get')")
@GetMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('social_tpredispatchinfo_get')" )
public R<TPreDispatchInfo> getById(@PathVariable("id" ) String id) {
return R.ok(tPreDispatchInfoService.getById(id));
}
......
......@@ -26,7 +26,6 @@ import com.yifu.cloud.plus.v1.yifu.social.entity.TDispatchInfo;
import com.yifu.cloud.plus.v1.yifu.social.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.web.bind.annotation.RequestBody;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
......@@ -58,6 +57,9 @@ public interface TDispatchInfoService extends IService<TDispatchInfo> {
R<List<ErrorMessage>> importReduceDiy(InputStream inputStream);
@GlobalTransactional
void batchReduceDispatch(List<TDispatchReduceVo> excelVOList, List<ErrorMessage> errorMessageList);
R<Boolean> removeByIdDiy(String id);
DispatchDetailVo getSocialAndFundInfoById(String id);
......
......@@ -1477,7 +1477,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
return R.ok(errorMessageList);
}
private void batchReduceDispatch(List<TDispatchReduceVo> excelVOList, List<ErrorMessage> errorMessageList) {
@GlobalTransactional
@Override
public void batchReduceDispatch(List<TDispatchReduceVo> excelVOList, List<ErrorMessage> errorMessageList) {
if (!Common.isNotNull(excelVOList)){
return;
}
......
......@@ -138,7 +138,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TPaymentInfo.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, TPaymentInfo.class).includeColumnFiledNames(searchVo.getExportFields()).build();;
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; ) {
......
......@@ -36,7 +36,11 @@ import com.yifu.cloud.plus.v1.yifu.insurances.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.social.constants.PreDispatchConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.*;
import com.yifu.cloud.plus.v1.yifu.social.mapper.*;
import com.yifu.cloud.plus.v1.yifu.social.service.TDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TPreDispatchInfoService;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchImportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TDispatchReduceVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchExportVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPreDispatchUpdateVo;
import lombok.RequiredArgsConstructor;
......@@ -79,6 +83,9 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
@Autowired
private TSocialInfoMapper socialInfoMapper;
@Autowired
private TDispatchInfoService dispatchInfoService;
/**
* 预派单记录简单分页查询
*
......@@ -326,12 +333,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
//项目名称map key:项目id value:项目名称
Map<String, String> settleDomainNameMap = new HashMap<>();
//客户名称map key:客户id value:客户名称
Map<String, String> customerNameMap = new HashMap<>();
//项目客户关系map key:项目id value:客户id
Map<String, String> settleIdAndCustomerIdMap = new HashMap<>();
listVo = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
......@@ -339,8 +340,6 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
settleDomainR = tSettleDomainListVo.getListSelectVO();
}
}
//map数据封装
initSettleDomainMaps(settleDomainR, settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap);
TPreDispatchInfo preInfo = baseMapper.selectById(id);
if (null == preInfo){
return R.failed(CommonConstants.ERROR_NO_DOMAIN);
......@@ -355,30 +354,57 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
HashMap<String,SysArea> areaMap = new HashMap<>();
HashMap<String,SysArea> areaIdMap = new HashMap<>();
// 派单派增处理
//todo
if (CommonConstants.ZERO_STRING.equals(preInfo.getType())) {
// EmployeeSocialFundImportVo importVo = new EmployeeSocialFundImportVo();
// // 初始化派增的派单数据
// initDispatchAddVo(preInfo, importVo);
// List<EmployeeSocialFundImportVo> importVoList = new ArrayList<>();
// importVoList.add(importVo);
// importVoList.add(importVo);
// // 如果档案地市空 只能用缴纳地封装,如果缴纳地有问题直接返回
// if (null == importVo.getFileCity()) {
// initAreaMap(areaMap, areaIdMap);
// // 处理 档案地市
// errorMessageList = handleFileAddress(1, preInfo, areaMap, areaIdMap, importVo, errorMessageList);
// }
// // 档案地市没问题 开始派单处理
// if (Common.isEmpty(errorMessageList)) {
// errorMessageList = dispatchInfoService.batchSaveEmployeeContractSocialFund(importVoList,
// settleIdAndCustomerIdMap, settleDomainNameMap, customerNameMap, user);
// }
// // 处理派增结果
// errorMessage = handleDispatchAddRes(preInfo, errorMessageList);
// if (null != errorMessage) {
// return errorMessage;
// }
TDispatchImportVo importVo = new TDispatchImportVo();
// 初始化派增的派单数据
initDispatchAddVo(preInfo, importVo);
List<TDispatchImportVo> importVoList = new ArrayList<>();
importVoList.add(importVo);
// 如果档案地市空 只能用缴纳地封装,如果缴纳地有问题直接返回
if (null == importVo.getFileCity()) {
R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
if (null == areaListR || areaListR.getCode() != CommonConstants.SUCCESS) {
return R.failed(PreDispatchConstants.GET_AREA_INFO);
}
initAreaMap(areaMap, areaIdMap, areaListR);
// 处理 档案地市
errorMessageList = handleFileAddress(1, preInfo, areaMap, areaIdMap, importVo, errorMessageList);
}
// 档案地市没问题 开始派单处理
if (Common.isEmpty(errorMessageList)) {
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user);
}
// 处理派增结果
errorMessage = handleDispatchAddRes(preInfo, errorMessageList);
if (null != errorMessage) {
return errorMessage;
}
}
// 派单派减处理
if (CommonConstants.ONE_STRING.equals(preInfo.getType())){
TDispatchReduceVo dispatchReduceVo = new TDispatchReduceVo();
dispatchReduceVo.setEmpName(preInfo.getEmpName());
dispatchReduceVo.setEmpIdcard(preInfo.getEmpIdcard());
if (Common.isNotNull(preInfo.getLeaveDate())){
dispatchReduceVo.setLeaveDate(preInfo.getLeaveDate());
}
dispatchReduceVo.setReasonType(preInfo.getLeaveReasonAdd());
dispatchReduceVo.setTrustRemark(preInfo.getLeaveReason());
if (Common.isNotNull(preInfo.getPensionEndReduce())) {
dispatchReduceVo.setSocialReduceDate(DateUtil.getFirstDay(preInfo.getPensionEndReduce()));
}
if (Common.isNotNull(preInfo.getFundEndReduce())){
dispatchReduceVo.setFundReduceDate(DateUtil.getFirstDay(preInfo.getFundEndReduce()));
}
List<TDispatchReduceVo> dispatchImportList = new ArrayList<>();
dispatchImportList.add(dispatchReduceVo);
dispatchInfoService.batchReduceDispatch(dispatchImportList, errorMessageList);
// 处理派减结果
errorMessage = handleDispatchAddRes(preInfo,errorMessageList);
if (null != errorMessage){
return errorMessage;
}
}
return R.ok();
}
......@@ -441,9 +467,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
// 封装需要派减的社保或公积金信息
initReduceSocialFundInfo(preList, socialMap, fundMap);
// 开始处理派增
List<ErrorMessage> errorMessageList;
List<ErrorMessage> errorMessageList = new ArrayList<>();
List<ErrorMessage> errorMsgList = new ArrayList<>();
TDispatchInfo dispatchInfo;
R<Boolean> res;
HashMap<String, SysArea> areaMap = new HashMap<>();
HashMap<String, SysArea> areaIdMap = new HashMap<>();
......@@ -454,40 +479,28 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
continue;
}
// 派单派增处理
//todo
// batchDispatchAdd(settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap, user, errorMsgList, i, pre,
// areaMap, areaIdMap);
batchDispatchAdd(settleDomainNameMap, customerNameMap, settleIdAndCustomerIdMap, user, errorMsgList, i, pre,
areaMap, areaIdMap);
// 派单派减处理
if (CommonConstants.ONE_STRING.equals(pre.getType())) {
dispatchInfo = new TDispatchInfo();
dispatchInfo.setEmpName(pre.getEmpName());
dispatchInfo.setEmpIdcard(pre.getEmpIdcard());
dispatchInfo.setEmpType(pre.getEmpTypeAdd());
dispatchInfo.setType(pre.getType());
dispatchInfo.setReduceReason(pre.getLeaveReasonAdd());
dispatchInfo.setReduceRemark(pre.getLeaveReason());
dispatchInfo.setTrustRemark(pre.getLeaveReason());
dispatchInfo.setBelongUnitName(customerNameMap.get(pre.getUnitIdAdd()));
dispatchInfo.setSettleDomainName(settleIdAndCustomerIdMap.get(pre.getDepartIdAdd()));
dispatchInfo.setFileAddr(pre.getPayAddress());
dispatchInfo.setPost(pre.getPositionAdd());
dispatchInfo.setEmpMobile(pre.getTelTwo());
// 处理派减派单时间
dispatchReduce(dispatchInfo, pre);
// 查看是否可以派减社保或公积金
res = handleBatchSocialFundReduce(pre, dispatchInfo, socialMap.get(pre.getEmpIdcard()), fundMap.get(pre.getEmpIdcard()));
if (res != null) {
errorMsgList.add(new ErrorMessage(i, pre.getEmpIdcard() + CommonConstants.COLON_STRING + res.getMsg()));
} else {
List<TDispatchInfo> dispatchImportList = new ArrayList<>();
dispatchImportList.add(dispatchInfo);
//todo
// errorMessageList = dispatchInfoService.batchDispatchReduce(dispatchImportList, settleIdAndCustomerIdMap, user);
// 处理派减结果
// handleDispatchAddRes(pre, errorMessageList);
// 重新组装数据
// resetMessageList(pre, errorMessageList, errorMsgList, i + 1);
TDispatchReduceVo dispatchReduceVo = new TDispatchReduceVo();
dispatchReduceVo.setEmpName(pre.getEmpName());
dispatchReduceVo.setEmpIdcard(pre.getEmpIdcard());
if (null != pre.getLeaveDate()){
dispatchReduceVo.setLeaveDate(pre.getLeaveDate());
}
dispatchReduceVo.setReasonType(pre.getLeaveReasonAdd());
dispatchReduceVo.setTrustRemark(pre.getLeaveReason());
// 处理派减派单时间
dispatchReduce(dispatchReduceVo, pre);
List<TDispatchReduceVo> dispatchImportList = new ArrayList<>();
dispatchImportList.add(dispatchReduceVo);
dispatchInfoService.batchReduceDispatch(dispatchImportList, errorMessageList);
//处理派减结果
handleDispatchAddRes(pre, errorMessageList);
//重新组装数据
resetMessageList(pre, errorMessageList, errorMsgList, i + 1);
}
}
return R.ok(errorMsgList);
......@@ -1048,8 +1061,8 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
* @param selectVo
* @param info
* @return
* @Author fxj
* @Date 2020-12-31
* @Author huyc
* @Date 2022-07-18
**/
private void initBaseInfo(String socialHouse, String fundHouse, TSettleDomainSelectVo selectVo, TPreDispatchInfo info) {
info.setType(CommonConstants.ZERO_STRING);
......@@ -2129,7 +2142,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
* @Date 2022-07-18
* @return
**/
private void dispatchReduce(TDispatchInfo dispatchInfo, TPreDispatchInfo pre) {
private void dispatchReduce(TDispatchReduceVo dispatchInfo, TPreDispatchInfo pre) {
if (Common.isNotNull(pre.getPensionEndReduce())) {
dispatchInfo.setSocialReduceDate(DateUtil.getFirstDay(pre.getPensionEndReduce()));
}
......@@ -2141,4 +2154,214 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
}
}
/**
* 初始化派增的派单数据
* @param preInfo
* @param importVo
* @Author huyc
* @Date 2022-07-18
* @return
**/
private void initDispatchAddVo(TPreDispatchInfo preInfo, TDispatchImportVo importVo) {
importVo.setEmpName(preInfo.getEmpName());
importVo.setEmpIdcard(preInfo.getEmpIdcard());
importVo.setEmpType(CommonConstants.TWO_STRING);
importVo.setEmpMobile(preInfo.getTelTwo());
importVo.setCustomerId(preInfo.getUnitIdAdd());
importVo.setCustomerCode(preInfo.getUnitNameAdd());
importVo.setSettleDomainId(preInfo.getDepartIdAdd());
importVo.setIdCardAddress(preInfo.getPayAddress());
importVo.setPost(preInfo.getPositionAdd());
importVo.setWorkingHours(preInfo.getWorkingHoursAdd());
importVo.setEmpNational(CommonConstants.ONE_STRING);
importVo.setEducationName(CommonConstants.FIVE_STRING);
if (null != preInfo.getPensionBase()){
importVo.setRecordBase(preInfo.getPensionBase().toString());
}
// 封装合同信息
initDispatchContractVo(preInfo, importVo);
// 封装社保派单信息
if (Common.isNotNull(preInfo.getSocialHouseAdd()) &&
Common.isNotNull(preInfo.getSocialProvince()) &&
Common.isNotNull(preInfo.getPensionStart())){
importVo.setPensionStart(DateUtil.getFirstDay(preInfo.getPensionStart()));
if (Common.isNotNull(preInfo.getPensionAddress())){
importVo.setSocialHousehold(preInfo.getSocialHouseAdd());
}
SysBaseSetInfo socialBaseSet = getSysBaseSetInfo(preInfo.getSocialProvince(),preInfo.getSocialCity(),
preInfo.getSocialTown(),preInfo.getSocialHouseAdd(),CommonConstants.ZERO_STRING);
// 初始化派单的社保基数
initDispatchSocialBase(preInfo, importVo, socialBaseSet);
}
// 封装公积金派单信息
initDispatchAddFund(preInfo, importVo);
}
private List<ErrorMessage> handleFileAddress(int i, TPreDispatchInfo pre,
HashMap<String, SysArea> areaMap,
HashMap<String, SysArea> areaIdMap,
TDispatchImportVo importVo,
List<ErrorMessage> errorMessageList) {
SysArea area = areaMap.get(pre.getPayAddress());
if (null == area || null == area.getParentId() || 0 == area.getParentId().intValue()){
errorMessageList = new ArrayList<>();
errorMessageList.add(new ErrorMessage(i+1,"缴费地址不存在或缴费地址不可为省!"));
}else {
SysArea areaParent = areaIdMap.get(area.getParentId());
if (null != areaParent && null != areaParent.getParentId() && 0 != areaParent.getParentId().intValue()) {
importVo.setFileProvince(areaParent.getParentId().toString());
importVo.setFileCity(areaParent.getId().toString());
importVo.setFileTown(area.getId().toString());
}else {
importVo.setFileProvince(area.getParentId().toString());
importVo.setFileCity(area.getId().toString());
importVo.setFileTown(null);
}
}
return errorMessageList;
}
/**
* 封装合同信息
* @param preInfo
* @param importVo
* @Author huyc
* @Date 2022-07-18
* @return
**/
private void initDispatchContractVo(TPreDispatchInfo preInfo, TDispatchImportVo importVo) {
if (Common.isNotNull(preInfo.getContractNameAdd())){
importVo.setContractName(CommonConstants.THREE_STRING);
if (Common.isNotNull(preInfo.getContractStartAdd())){
importVo.setContractStart(DateUtil.stringToDate(ServiceUtil.
replaceSeparator(preInfo.getContractStartAdd(),CommonConstants.CENTER_SPLIT_LINE_STRING,
CommonConstants.SLASH_SPLIT_LINE_STRING), DateUtil.ISO_DATE_FORMAT));
}
if (Common.isNotNull(preInfo.getContractEndAdd())){
importVo.setContractEnd(DateUtil.stringToDate(ServiceUtil.
replaceSeparator(preInfo.getContractEndAdd(), CommonConstants.CENTER_SPLIT_LINE_STRING,
CommonConstants.SLASH_SPLIT_LINE_STRING), DateUtil.ISO_DATE_FORMAT));
}
importVo.setContractTerm(CommonConstants.TWO_STRING);
importVo.setContractType(CommonConstants.ONE_STRING);
importVo.setContractSubName(PreDispatchConstants.CONTRACT_NAME);
}
}
/**
* 初始化派单的社保基数
* @Author huyc
* @Date 2022-07-18
* @param preInfo
* @param importVo
* @param socialBaseSet
* @return
**/
private void initDispatchSocialBase(TPreDispatchInfo preInfo, TDispatchImportVo importVo, SysBaseSetInfo socialBaseSet) {
if (Common.isNotNull(preInfo.getSocialProvince())){
importVo.setFileProvince(preInfo.getSocialProvince());
importVo.setIdCardProvince(preInfo.getSocialProvince());
}
if (Common.isNotNull(preInfo.getSocialCity())){
importVo.setFileCity(preInfo.getSocialCity());
importVo.setIdCardCity(preInfo.getSocialCity());
}
if (Common.isNotNull(preInfo.getSocialTown())){
importVo.setFileTown(preInfo.getSocialTown());
importVo.setIdCardTown(preInfo.getSocialTown());
}
if (null != socialBaseSet){
// 最低
if (socialBaseSet.getLowerLimit().compareTo(Common.isBlankToBigDecimalZero(preInfo.getPensionBase())) ==
CommonConstants.ZERO_INT){
importVo.setPaymentType(CommonConstants.ZERO_STRING);
// 最高
}else if (socialBaseSet.getUpperLimit().compareTo(Common.isBlankToBigDecimalZero(preInfo.getPensionBase())) ==
CommonConstants.ZERO_INT){
importVo.setPaymentType(CommonConstants.TWO_STRING);
}else {
importVo.setPaymentType(CommonConstants.ONE_STRING);
}
}else {
importVo.setPaymentType(CommonConstants.ONE_STRING);
}
// 自定义
importVo.setPaymentType(CommonConstants.ONE_STRING);
importVo.setPensionCardinal(preInfo.getPensionBase());
importVo.setMedicalCardinal(preInfo.getPensionBase());
importVo.setUnemploymentCardinal(preInfo.getPensionBase());
importVo.setWorkInjuryCardinal(preInfo.getPensionBase());
importVo.setBirthCardinal(preInfo.getPensionBase());
importVo.setBigailmentCardinal(preInfo.getPensionBase());
}
/**
* 封装公积金派单信息
* @Author huyc
* @Date 2022-07-18
* @param preInfo
* @param importVo
* @return
**/
private void initDispatchAddFund(TPreDispatchInfo preInfo, TDispatchImportVo importVo) {
if (Common.isNotNull(preInfo.getFundStart())){
importVo.setProvidentStart(DateUtil.getFirstDay(preInfo.getFundStart()));
}
if (Common.isNotNull(preInfo.getFundBase())){
importVo.setProvidentCardinal(preInfo.getFundBase());
importVo.setProvidentPer(preInfo.getFundPersonalPer());
}
if (Common.isNotNull(preInfo.getFundAddress())){
importVo.setProvidentHousehold(preInfo.getFundHouseAdd());
}
}
/**
* 批量派单派增处理
* @Author huyc
* @Date 2022-07-18
* @param settleDomainNameMap
* @param customerNameMap
* @param settleIdAndCustomerIdMap
* @param user
* @param errorMsgList
* @param i
* @param pre
* @param areaMap
* @param areaIdMap
* @return
**/
private void batchDispatchAdd(Map<String, String> settleDomainNameMap, Map<String, String> customerNameMap,
Map<String, String> settleIdAndCustomerIdMap, YifuUser user,
List<ErrorMessage> errorMsgList, int i, TPreDispatchInfo pre,
HashMap<String, SysArea> areaMap,
HashMap<String, SysArea> areaIdMap) {
TDispatchImportVo importVo;
List<ErrorMessage> errorMessageList = new ArrayList<>();
if (null != pre && CommonConstants.ZERO_STRING.equals(pre.getType())){
importVo = new TDispatchImportVo();
// 初始化派增的派单数据
initDispatchAddVo(pre, importVo);
List<TDispatchImportVo> importVoList = new ArrayList<>();
importVoList.add(importVo);
// 如果档案地市空 只能用缴纳地封装,如果缴纳地有问题直接返回
if (null == importVo.getFileCity()){
R<AreaVo> areaListR = upmsDaprUtils.getAreaListR();
if (null == areaListR || areaListR.getCode() != CommonConstants.SUCCESS) {
errorMessageList.add(new ErrorMessage(i+1,PreDispatchConstants.GET_AREA_INFO));
}
initAreaMap(areaMap, areaIdMap,areaListR);
// 处理 档案地市
errorMessageList = handleFileAddress(i, pre, areaMap, areaIdMap, importVo, errorMessageList);
}
// 档案地市没问题 开始派单处理
if (Common.isEmpty(errorMessageList)){
dispatchInfoService.importTDispatchInfo(importVoList, errorMessageList, user);
}
// 处理派增结果
handleDispatchAddRes(pre, errorMessageList);
// 重新组装数据
resetMessageList(pre, errorMessageList, errorMsgList, i+1);
}
}
}
......@@ -115,4 +115,16 @@ public class ServiceUtil {
}
return str;
}
public static String replaceSeparator(String string,String str1, String... strn){
if (null != str1) {
string = string.replace(str1,CommonConstants.EMPTY_STRING);
}
if (null != strn) {
for (String str : strn) {
string = string.replace(str,CommonConstants.EMPTY_STRING);
}
}
return string;
}
}
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