Commit 348de57c authored by huyuchen's avatar huyuchen

缴费库修改

parent fd37f421
......@@ -35,17 +35,10 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TPaymentVo;
import com.yifu.cloud.plus.v1.yifu.social.concurrent.threadpool.YFSocialImportThreadPoolExecutor;
import com.yifu.cloud.plus.v1.yifu.social.constants.PaymentConstants;
import com.yifu.cloud.plus.v1.yifu.social.constants.SocialConstants;
import com.yifu.cloud.plus.v1.yifu.social.entity.SysHouseHoldInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentInfo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TProvidentFund;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import com.yifu.cloud.plus.v1.yifu.social.mapper.SysHouseHoldInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TPaymentInfoMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TProvidentFundMapper;
import com.yifu.cloud.plus.v1.yifu.social.mapper.TSocialInfoMapper;
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.TPaymentInfoImportLogService;
import com.yifu.cloud.plus.v1.yifu.social.service.TPaymentInfoService;
import com.yifu.cloud.plus.v1.yifu.social.util.ServiceUtil;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentHeFeiVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoSearchVo;
import com.yifu.cloud.plus.v1.yifu.social.vo.TPaymentInfoVo;
......@@ -103,6 +96,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
@Autowired
private TPaymentInfoImportLogService tPaymentInfoImportLogService;
@Autowired
private TSocialFundInfoMapper socialFundInfoMapper;
@Autowired
private TSocialInfoMapper socialInfoMapper;
......@@ -692,24 +688,17 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
int i = idx;
if (Common.isNotNull(list)) {
TPaymentInfo paymentInfo = null;
TSocialInfo socialInfo = null;
TSocialFundInfo socialInfo = null;
String temp = null;
int res = -1;
// 全部办理成功 和 部分办理失败
List<TSocialInfo> socialInfoList = socialInfoMapper.selectList(Wrappers.<TSocialInfo>query().lambda()
.in(TSocialInfo::getEmpIdcard, Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD))
.and(obj -> obj.eq(TSocialInfo::getHandleStatus, CommonConstants.ONE_STRING)
.or().eq(TSocialInfo::getHandleStatus, CommonConstants.FIVE_STRING))
.eq(TSocialInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
//已派减的
List<TSocialInfo> socialInfoListTemp = socialInfoMapper.selectList(Wrappers.<TSocialInfo>query().lambda()
.in(TSocialInfo::getEmpIdcard, Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD))
.eq(TSocialInfo::getHandleStatus, CommonConstants.THREE_STRING)
.eq(TSocialInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
List<TSocialFundInfo> socialInfoList = socialFundInfoMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda()
.in(TSocialFundInfo::getEmpIdcard, Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD)));
//已存在的社保数据
HashMap<String, TSocialInfo> socialMap = new HashMap<>();
HashMap<String, TSocialFundInfo> socialMap = new HashMap<>();
if (Common.isNotNull(socialInfoList)) {
for (TSocialInfo tSocialInfo : socialInfoList) {
for (TSocialFundInfo tSocialInfo : socialInfoList) {
socialMap.put(tSocialInfo.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo.getSocialCity()
......@@ -718,38 +707,9 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
//已存在的派减社保数据
HashMap<String, TSocialInfo> socialMapTemp = new HashMap<>();
if (Common.isNotNull(socialInfoListTemp)) {
for (TSocialInfo tSocialInfo : socialInfoListTemp) {
socialMapTemp.put(tSocialInfo.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo.getSocialCity()
+ CommonConstants.DOWN_LINE_STRING + (null == tSocialInfo.getSocialTown()
? "null" : tSocialInfo.getSocialTown()), tSocialInfo);
}
}
String[] areaArray;
String checkRes;
Map<String,String> cusMap = new HashMap<>();
Map<String,String> itemMap = new HashMap<>();
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
listVo = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
}
}
if(CollectionUtils.isNotEmpty(settleDomainR)){
for (TSettleDomainSelectVo tSettleDomainSelectVo : settleDomainR) {
cusMap.put(tSettleDomainSelectVo.getCustomerId(), tSettleDomainSelectVo.getCustomerName());
itemMap.put(tSettleDomainSelectVo.getId(), tSettleDomainSelectVo.getDepartName());
}
}
for (TPaymentInfoVo infoVo : list) {
atomicLine.incrementAndGet();
++i;
......@@ -770,17 +730,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
continue;
}
//无对应员工的社保数据
if (null != socialMap || null != socialMapTemp) {
if (null != socialMap) {
//采用客服导入的地址
areaArray = infoVo.getSocialPayAddr().split(CommonConstants.CENTER_SPLIT_LINE_STRING);
infoVo = initAddress(areaArray, areaMap2, infoVo);
if (null != socialMap) {
socialInfo = socialMap.get(infoVo.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING + infoVo.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + infoVo.getSocialCity()
+ CommonConstants.DOWN_LINE_STRING + (null == infoVo.getSocialTown()
? "null" : infoVo.getSocialTown()));
}
socialInfo = socialMap.get(infoVo.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING + infoVo.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + infoVo.getSocialCity()
+ CommonConstants.DOWN_LINE_STRING + (null == infoVo.getSocialTown()
? "null" : infoVo.getSocialTown()));
//对身份证与人员姓名的对应关系进行校验
if (socialInfo != null && !socialInfo.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "姓名与身份证信息不一致,请核实后再次尝试!"));
......@@ -790,39 +748,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), infoVo.getEmpIdcard() + "的社保起缴日期为空!"));
continue;
}
if (null == socialInfo || (null != socialInfo && !ServiceUtil.checkMothForPaymentImport(
socialInfo.getSocialStartDate(), infoVo.getSocialPayMonth(), socialInfo.getSocialReduceDate()))) {
if (socialMapTemp.size() > CommonConstants.ZERO_INT) {
socialInfo = socialMapTemp.get(infoVo.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING + infoVo.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + infoVo.getSocialCity()
+ CommonConstants.DOWN_LINE_STRING + (null == infoVo.getSocialTown()
? "null" : infoVo.getSocialTown()));
//对身份证与人员姓名的对应关系进行校验
if (socialInfo != null && !socialInfo.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), infoVo.getEmpIdcard() +
"姓名与身份证信息不一致,请核实后再次尝试!"));
continue;
}
if (null != socialInfo && !ServiceUtil.checkMothForPaymentImport(socialInfo.getSocialStartDate()
, infoVo.getSocialPayMonth(), socialInfo.getSocialReduceDate())) {
socialInfo = null;
for (TSocialInfo s : socialInfoListTemp) {
if (s.getEmpIdcard().equals(infoVo.getEmpIdcard()) && ServiceUtil.checkMothForPaymentImport(
s.getSocialStartDate(), infoVo.getSocialPayMonth(), s.getSocialReduceDate())) {
socialInfo = checkAddress(areaArray, areaMap, s);
if (null != socialInfo) {
break;
}
}
}
}
}
}
}
if (null == socialInfo) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "无对应员工" +
infoVo.getEmpIdcard() + "的社保数据(请查验社保办理状态|缴纳地|起缴月份|停缴月份)"));
infoVo.getEmpIdcard() + "的社保数据(请查验社保缴纳地)"));
continue;
}
//如果导入项目数大于办理成功项目数给提示,少于给进,有问题自行删除后导入
......@@ -986,20 +915,22 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo = null;
}
TSocialInfo tSocialInfo = socialInfoMapper.selectOne(Wrappers.<TSocialInfo>query().lambda()
.eq(TSocialInfo::getEmpIdcard, infoVo.getEmpIdcard()).groupBy(TSocialInfo::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (null == paymentInfo) {
paymentInfo = new TPaymentInfo();
paymentInfo.setLockStatus(CommonConstants.ZERO_STRING);
paymentInfo.setEmpId(socialInfo.getEmpId());
paymentInfo.setEmpIdcard(socialInfo.getEmpIdcard());
paymentInfo.setEmpName(socialInfo.getEmpName());
paymentInfo.setEmpNo(socialInfo.getEmpNo());
if (Common.isNotNull(itemMap) && Common.isNotNull(cusMap)) {
paymentInfo.setSettleDomainId(itemMap.get(socialInfo.getSettleDomain()));
paymentInfo.setUnitId(cusMap.get(socialInfo.getBelongUnit()));
paymentInfo.setSettleDomainId(socialInfo.getSettleDomainName());
paymentInfo.setUnitId(socialInfo.getUnitName());
if (Common.isNotNull(tSocialInfo)) {
paymentInfo.setInauguralTeam(tSocialInfo.getInauguralTeam());
paymentInfo.setEmpNo(tSocialInfo.getEmpNo());
}
paymentInfo.setInauguralTeam(socialInfo.getInauguralTeam());
paymentInfo.setTelecomNumber(socialInfo.getTelecomNumber());
}
paymentInfo.setSocialProvince(socialInfo.getSocialProvince());
paymentInfo.setSocialCity(socialInfo.getSocialCity());
......@@ -1090,44 +1021,12 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
itemMap.clear();
cusMap.clear();
}
return errorMessageList;
}
//比对缴纳地是否一致
private TSocialInfo checkAddress(String[] areaArray, HashMap<String, String> areaMap, TSocialInfo s) {
if (null == areaArray || null == areaMap || null == s) {
return null;
}
if (areaArray.length >= CommonConstants.TWO_INT) {
if (null != s.getSocialProvince()) {
if (areaArray[0].equals(areaMap.get(s.getSocialProvince()))) {
if (null != s.getSocialCity()) {
if (areaArray[1].equals(areaMap.get(s.getSocialCity()))) {
if (areaArray.length >= CommonConstants.THREE_INT) {
if (null != s.getSocialTown() && areaArray[CommonConstants.TWO_INT].equals(
areaMap.get(s.getSocialTown()))) {
return s;
}
} else {
if (null == s.getSocialTown()) {
return s;
}
}
}
} else {
return null;
}
}
} else {
return null;
}
}
return null;
private String concatStr(String socialType) {
return "存在未办理成功的险种:" + socialType + ",请办理成功后,再行导入!";
}
/**
......@@ -1139,7 +1038,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
* @Author fxj
* @Date 2021-06-21
**/
private String checkRepeatInfo(TSocialInfo socialInfo, TPaymentInfoVo infoVo) {
private String checkRepeatInfo(TSocialFundInfo socialInfo, TPaymentInfoVo infoVo) {
if (checkHandleMoney(socialInfo.getPensionHandle(),
infoVo.getUnitPensionMoney(), infoVo.getPersonalPensionMoney())) {
return concatStr("养老");
......@@ -1174,10 +1073,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
return null;
}
private String concatStr(String socialType) {
return "存在未办理成功的险种:" + socialType + ",请办理成功后,再行导入!";
}
private boolean checkHandleMoney(String handleStatus, BigDecimal unitMoney, BigDecimal personalMoney) {
return CommonConstants.TWO_STRING.equals(handleStatus) &&
(Common.isBlankToBigDecimalZero(unitMoney).compareTo(BigDecimal.ZERO) > CommonConstants.ZERO_INT ||
......@@ -1335,7 +1230,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
try {
if (Common.isNotNull(list)) {
TPaymentInfo paymentInfo = null;
TProvidentFund fund = null;
TSocialFundInfo fund = null;
String temp = null;
int res = -1;
......@@ -1343,21 +1238,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
List<String> idcards = list.stream().map(TPaymentInfoVo::getEmpIdcard).collect(Collectors.toList());
//已存在档案数据
//已存在派增公积金数据
List<TProvidentFund> fundList = providentFundMapper.selectList(Wrappers.<TProvidentFund>query().lambda()
.eq(TProvidentFund::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TProvidentFund::getHandleStatus, CommonConstants.ONE_STRING)
.in(TProvidentFund::getEmpIdcard, idcards));
List<TSocialFundInfo> fundList = socialFundInfoMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda()
.in(TSocialFundInfo::getEmpIdcard, Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD)));
HashMap<String, Object> fundMap = fundList.stream().collect(HashMap::new, (m, v) ->
m.put(v.getEmpIdcard(), v), HashMap::putAll);
//已存在派减的公积金数据
List<TProvidentFund> fundListTemp = providentFundMapper.selectList(Wrappers.<TProvidentFund>query().lambda()
.eq(TProvidentFund::getDeleteFlag, CommonConstants.ZERO_STRING)
.eq(TProvidentFund::getHandleStatus, CommonConstants.THREE_STRING)
.in(TProvidentFund::getEmpIdcard, idcards));
HashMap<String, Object> fundMapTemp = fundListTemp.stream().collect(HashMap::new, (m, v) ->
m.put(v.getEmpIdcard(), v), HashMap::putAll);
List<String> monthList = list.stream().map(TPaymentInfoVo::getProvidentPayMonth).collect(Collectors.toList());
//已存在社保缴费库数据 非删除状态
......@@ -1380,23 +1265,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
String[] areaArray = null;
Map<String,String> cusMap = new HashMap<>();
Map<String,String> itemMap = new HashMap<>();
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
listVo = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
}
}
if(CollectionUtils.isNotEmpty(settleDomainR)){
for (TSettleDomainSelectVo tSettleDomainSelectVo : settleDomainR) {
cusMap.put(tSettleDomainSelectVo.getCustomerId(), tSettleDomainSelectVo.getCustomerName());
itemMap.put(tSettleDomainSelectVo.getId(), tSettleDomainSelectVo.getDepartName());
}
}
for (TPaymentInfoVo infoVo : list) {
if (Common.isNotNull(infoVo.getEmpIdcard())) {
infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X"));
......@@ -1432,51 +1300,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
+ CommonConstants.DOWN_LINE_STRING + "公积金缴纳地不可为空!"));
continue;
}
if (fundMap.size() >CommonConstants.ZERO_INT || fundMapTemp.size() >CommonConstants.ZERO_INT) {
if (fundMap.size() >CommonConstants.ZERO_INT) {
fund = (TProvidentFund) fundMap.get(infoVo.getEmpIdcard());
//对身份证与人员姓名的对应关系进行校验
if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add
(new ErrorMessage(infoVo.getRowIndex(), "姓名与身份证信息不一致,请核实后再次尝试!"));
continue;
}
if (fundMap.size() >CommonConstants.ZERO_INT) {
fund = (TSocialFundInfo) fundMap.get(infoVo.getEmpIdcard());
//对身份证与人员姓名的对应关系进行校验
if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add
(new ErrorMessage(infoVo.getRowIndex(), "姓名与身份证信息不一致,请核实后再次尝试!"));
continue;
}
areaArray = infoVo.getProvidentPayAddr().split(CommonConstants.CENTER_SPLIT_LINE_STRING);
fund = checkAddress(areaArray, areaMap,fund);
if (null == fund || (null != fund && !ServiceUtil.checkMothForPaymentImport(
fund.getProvidentStart(), infoVo.getProvidentPayMonth(), fund.getFundReduceDate()))) {
if (fundMapTemp.size() >CommonConstants.ZERO_INT) {
fund = (TProvidentFund) fundMapTemp.get(infoVo.getEmpIdcard());
//对身份证与人员姓名的对应关系进行校验
if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) {
if (null != fund && !fund.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add
(new ErrorMessage(infoVo.getRowIndex(), "姓名与身份证信息不一致,请核实后再次尝试!"));
continue;
}
fund = checkAddress(areaArray, areaMap, fund);
if (null != fund && !ServiceUtil.checkMothForPaymentImport(
fund.getProvidentStart(), infoVo.getProvidentPayMonth(), fund.getFundReduceDate())) {
fund = null;
for (TProvidentFund f : fundListTemp) {
if (f.getEmpIdcard().equals(infoVo.getEmpIdcard()) && ServiceUtil.checkMothForPaymentImport(
f.getProvidentStart(), infoVo.getProvidentPayMonth(), f.getFundReduceDate())) {
fund = checkAddress(areaArray, areaMap,f);
if (null != fund) {
break;
}
}
}
}
}
}
}
fund = checkAddress(areaArray, areaMap, fund);
//无对应员工公积金数据
if (null == fund) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "无对应员工" + infoVo.getEmpName() +
CommonConstants.DOWN_LINE_STRING + infoVo.getEmpIdcard()
+ "的公积金数据(请查验公积金办理状态|缴纳地|起缴月份|停缴月份)!"));
+ "的公积金数据(请查验公积金缴纳地)!"));
continue;
}
//查看是否有操作对应主体的权限
......@@ -1514,19 +1352,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo = null;
}
TProvidentFund tProvidentFund = providentFundMapper.selectOne(Wrappers.<TProvidentFund>query().lambda()
.eq(TProvidentFund::getEmpIdcard, infoVo.getEmpIdcard()).groupBy(TProvidentFund::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (null == paymentInfo) {
paymentInfo = new TPaymentInfo();
paymentInfo.setLockStatus(CommonConstants.ZERO_STRING);
paymentInfo.setEmpId(fund.getEmpId());
paymentInfo.setEmpIdcard(fund.getEmpIdcard());
paymentInfo.setEmpName(fund.getEmpName());
paymentInfo.setEmpNo(fund.getEmpNo());
if (Common.isNotNull(itemMap) && Common.isNotNull(cusMap)) {
paymentInfo.setSettleDomainId(itemMap.get(fund.getSettleDomain()));
paymentInfo.setUnitId(cusMap.get(fund.getBelongUnit()));
paymentInfo.setSettleDomainId(fund.getSettleDomainNameFund());
paymentInfo.setUnitId(fund.getUnitNameFund());
if (Common.isNotNull(tProvidentFund)) {
paymentInfo.setInauguralTeam(tProvidentFund.getInauguralTeam());
paymentInfo.setEmpNo(tProvidentFund.getEmpNo());
}
paymentInfo.setInauguralTeam(fund.getInauguralTeam());
paymentInfo.setTelecomNumber(fund.getTelecomNumber());
}
paymentInfo.setProvidentPayMonth(infoVo.getProvidentPayMonth());
paymentInfo.setFundProvince(fund.getFundProvince());
......@@ -1594,8 +1434,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
itemMap.clear();
cusMap.clear();
} else {
errorMessageList.add(new ErrorMessage(-1, "无数据可导入!"));
}
......@@ -1857,25 +1695,18 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
int i = idx;
if (Common.isNotNull(list)) {
TPaymentInfo payExists = null;
TSocialInfo socialInfo = null;
TSocialFundInfo socialInfo = null;
String temp;
int res = -1;
List<String> idcards = Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD);
// 全部办理成功 和 部分办理失败
List<TSocialInfo> socialInfoList = socialInfoMapper.selectList(Wrappers.<TSocialInfo>query().lambda()
.in(TSocialInfo::getEmpIdcard, idcards)
.and(obj -> obj.eq(TSocialInfo::getHandleStatus, CommonConstants.ONE_STRING)
.or().eq(TSocialInfo::getHandleStatus, CommonConstants.FIVE_STRING))
.eq(TSocialInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
//已派减的
List<TSocialInfo> socialInfoListTemp = socialInfoMapper.selectList(Wrappers.<TSocialInfo>query().lambda()
.in(TSocialInfo::getEmpIdcard, idcards)
.eq(TSocialInfo::getHandleStatus, CommonConstants.THREE_STRING)
.eq(TSocialInfo::getDeleteFlag, CommonConstants.ZERO_STRING));
List<TSocialFundInfo> socialInfoList = socialFundInfoMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda()
.in(TSocialFundInfo::getEmpIdcard, Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD)));
//已存在的社保数据
HashMap<String, TSocialInfo> socialMap = new HashMap<>();
HashMap<String, TSocialFundInfo> socialMap = new HashMap<>();
if (Common.isNotNull(socialInfoList)) {
for (TSocialInfo tSocialInfo : socialInfoList) {
for (TSocialFundInfo tSocialInfo : socialInfoList) {
socialMap.put(tSocialInfo.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo.getSocialCity()
......@@ -1883,38 +1714,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
? "null" : tSocialInfo.getSocialTown()), tSocialInfo);
}
}
//已存在的派减社保数据
HashMap<String, TSocialInfo> socialMapTemp = new HashMap<>();
if (Common.isNotNull(socialInfoListTemp)) {
for (TSocialInfo tSocialInfo : socialInfoListTemp) {
socialMapTemp.put(tSocialInfo.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo.getSocialCity()
+ CommonConstants.DOWN_LINE_STRING + (null == tSocialInfo.getSocialTown()
? "null" : tSocialInfo.getSocialTown()), tSocialInfo);
}
}
String[] areaArray;
String checkRes;
Map<String,String> cusMap = new HashMap<>();
Map<String,String> itemMap = new HashMap<>();
List<TSettleDomainSelectVo> settleDomainR = null;
R<TSettleDomainListVo> listVo = null;
listVo = archivesDaprUtil.selectAllSettleDomainSelectVos();
if (Common.isNotNull(listVo)) {
TSettleDomainListVo tSettleDomainListVo = listVo.getData();
if (Common.isNotNull(tSettleDomainListVo) && Common.isNotEmpty(tSettleDomainListVo.getListSelectVO())) {
settleDomainR = tSettleDomainListVo.getListSelectVO();
}
}
if(CollectionUtils.isNotEmpty(settleDomainR)){
for (TSettleDomainSelectVo tSettleDomainSelectVo : settleDomainR) {
cusMap.put(tSettleDomainSelectVo.getCustomerId(), tSettleDomainSelectVo.getCustomerName());
itemMap.put(tSettleDomainSelectVo.getId(), tSettleDomainSelectVo.getDepartName());
}
}
for (TPaymentHeFeiVo infoVo : list) {
atomicLine.incrementAndGet();
++i;
......@@ -1926,16 +1729,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
continue;
}
//无对应员工的社保数据
if (socialMap.size() >CommonConstants.ZERO_INT || socialMapTemp.size() >CommonConstants.ZERO_INT) {
if (socialMap.size() >CommonConstants.ZERO_INT) {
//采用客服导入的地址
areaArray = infoVo.getSocialPayAddr().split(CommonConstants.CENTER_SPLIT_LINE_STRING);
infoVo = initAddressThree(areaArray, areaMap2, infoVo);
if (socialMap.size() >CommonConstants.ZERO_INT) {
socialInfo = socialMap.get(infoVo.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING + infoVo.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + infoVo.getSocialCity()
+ CommonConstants.DOWN_LINE_STRING + (null == infoVo.getSocialTown() ? "null" : infoVo.getSocialTown()));
}
socialInfo = socialMap.get(infoVo.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING + infoVo.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + infoVo.getSocialCity()
+ CommonConstants.DOWN_LINE_STRING + (null == infoVo.getSocialTown() ? "null" : infoVo.getSocialTown()));
//对身份证与人员姓名的对应关系进行校验
if (socialInfo != null && !socialInfo.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "姓名与身份证信息不一致,请核实后再次尝试!"));
......@@ -1945,37 +1747,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), infoVo.getEmpIdcard() + "的社保起缴日期为空!"));
continue;
}
if (null == socialInfo || (null != socialInfo && !ServiceUtil.checkMothForPaymentImport(
socialInfo.getSocialStartDate(), infoVo.getSocialPayMonth(), socialInfo.getSocialReduceDate()))) {
if (socialMapTemp.size() >CommonConstants.ZERO_INT) {
socialInfo = socialMapTemp.get(infoVo.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING + infoVo.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + infoVo.getSocialCity()
+ CommonConstants.DOWN_LINE_STRING + (null == infoVo.getSocialTown() ? "null" : infoVo.getSocialTown()));
//对身份证与人员姓名的对应关系进行校验
if (socialInfo != null && !socialInfo.getEmpName().equals(infoVo.getEmpName())) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "姓名与身份证信息不一致,请核实后再次尝试!"));
continue;
}
if (null != socialInfo && !ServiceUtil.checkMothForPaymentImport(socialInfo.getSocialStartDate()
, infoVo.getSocialPayMonth(), socialInfo.getSocialReduceDate())) {
socialInfo = null;
for (TSocialInfo s : socialInfoListTemp) {
if (s.getEmpIdcard().equals(infoVo.getEmpIdcard()) && ServiceUtil.checkMothForPaymentImport(
s.getSocialStartDate(), infoVo.getSocialPayMonth(), s.getSocialReduceDate())) {
socialInfo = checkAddress(areaArray, areaMap, s);
if (null != socialInfo) {
break;
}
}
}
}
}
}
}
if (null == socialInfo) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "无对应员工" + infoVo.getEmpIdcard() +
"的社保数据(请查验社保办理状态|缴纳地|起缴月份|停缴月份)"));
"的社保数据(请查验社保缴纳地)"));
continue;
}
//如果导入项目数大于办理成功项目数给提示,少于给进,有问题自行删除后导入
......@@ -2118,19 +1893,21 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
TSocialInfo tSocialInfo = socialInfoMapper.selectOne(Wrappers.<TSocialInfo>query().lambda()
.eq(TSocialInfo::getEmpIdcard, infoVo.getEmpIdcard()).groupBy(TSocialInfo::getCreateTime)
.last(CommonConstants.LAST_ONE_SQL));
if (null == payExists) {
payExists = new TPaymentInfo();
payExists.setLockStatus(CommonConstants.ZERO_STRING);
payExists.setEmpId(socialInfo.getEmpId());
payExists.setEmpIdcard(socialInfo.getEmpIdcard());
payExists.setEmpName(socialInfo.getEmpName());
payExists.setEmpNo(socialInfo.getEmpNo());
if (Common.isNotNull(itemMap) && Common.isNotNull(cusMap)) {
payExists.setSettleDomainId(itemMap.get(socialInfo.getSettleDomain()));
payExists.setUnitId(cusMap.get(socialInfo.getBelongUnit()));
payExists.setSettleDomainId(socialInfo.getSettleDomainName());
payExists.setUnitId(socialInfo.getUnitName());
if (Common.isNotNull(tSocialInfo)) {
payExists.setInauguralTeam(tSocialInfo.getInauguralTeam());
payExists.setEmpNo(tSocialInfo.getEmpNo());
}
payExists.setInauguralTeam(socialInfo.getInauguralTeam());
payExists.setTelecomNumber(socialInfo.getTelecomNumber());
}
payExists.setSocialProvince(socialInfo.getSocialProvince());
payExists.setSocialCity(socialInfo.getSocialCity());
......@@ -2219,8 +1996,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
}
}
itemMap.clear();
cusMap.clear();
}
return errorMessageList;
}
......@@ -2290,7 +2065,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
* @Author huyc
* @Date 2022-07-27
**/
private String checkRepeatInfoThree(TSocialInfo socialInfo, TPaymentHeFeiVo infoVo, String type) {
private String checkRepeatInfoThree(TSocialFundInfo socialInfo, TPaymentHeFeiVo infoVo, String type) {
if (CommonConstants.ZERO_STRING.equals(type)) {
if (PaymentConstants.PENSION_RISK.equals(infoVo.getRiskType())
&& checkHandleMoney(socialInfo.getPensionHandle(),
......@@ -2322,7 +2097,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
//比对缴纳地是否一致
private TProvidentFund checkAddress(String[] areaArray, HashMap<String, String> areaMap, TProvidentFund s) {
private TSocialFundInfo checkAddress(String[] areaArray, HashMap<String, String> areaMap, TSocialFundInfo s) {
if (null == areaArray || null == areaMap || null == s) {
return null;
}
......
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