Commit 842d1d6e authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.5' into MVP1.5

parents 4c6502cc 15d6e033
......@@ -50,6 +50,8 @@ public class ErrorDetailVO implements Serializable {
// 提示信息
private String message;
// 颜色
private String color = "red";
// 所有行的结果,当第一行的allTrue=1时,需要反馈文件,否则直接提示成功
private int allTrue = 0;
......@@ -70,4 +72,15 @@ public class ErrorDetailVO implements Serializable {
this.message = message;
}
public ErrorDetailVO(Integer lineNum, int result, String empIdCard, String socialHousehold, String providentHousehold, String empName,String message,String color) {
this.lineNum = lineNum;
this.result = result;
this.empIdCard = empIdCard;
this.socialHousehold = socialHousehold;
this.providentHousehold = providentHousehold;
this.empName = empName;
this.message = message;
this.color = color;
}
}
......@@ -78,4 +78,10 @@ public class InsuranceHandleImportParam implements Serializable {
*/
@Schema(description = "错误信息")
private String errorMessage;
/**
* 错误标志 0 正确 1错误
*/
@Schema(description = "错误标志")
private String flag;
}
......@@ -94,6 +94,12 @@ public class InsuranceInsuredParam implements Serializable {
@Schema(description = "错误信息")
private String errorMessage;
/**
* 错误标志 0 正确 1错误
*/
@Schema(description = "错误标志")
private String flag;
/**
* 数据传递对象
*/
......
......@@ -64,6 +64,11 @@ public class InsuranceRegisterInvoiceNoParam implements Serializable {
@Schema(description = "发票号")
private String invoiceNo;
/**
* 错误标志 0 正确 1错误
*/
@Schema(description = "错误标志")
private String flag;
/**
* 错误信息
......
......@@ -83,6 +83,12 @@ public class InsuranceRegisterParam implements Serializable {
@Schema(description = "错误信息")
private String errorMessage;
/**
* 错误标志 0 正确 1错误
*/
@Schema(description = "错误标志")
private String flag;
/**
* 数据传递对象
*/
......
......@@ -3387,6 +3387,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
outer:
for (int i = 0; i < distinctList.size(); i++) {
InsuranceRegisterParam param = distinctList.get(i);
param.setFlag(CommonConstants.ONE_STRING);
// 必填校验
if (StringUtils.isBlank(param.getEmpName())){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
......@@ -3635,6 +3636,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
param.setErrorMessage(CommonConstants.RESULT_DATA_SUCESS);
param.setFlag(CommonConstants.ZERO_STRING);
//所有校验通过后设置查到的结果
param.setDetail(detail);
}
......@@ -3652,6 +3654,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
private List<InsuranceRegisterInvoiceNoParam> registeredInvoiceNoCheck(List<InsuranceRegisterInvoiceNoParam> paramList, List<TInsuranceAreaRes> insuranceAreaResList){
List<InsuranceRegisterInvoiceNoParam> collect = paramList.stream().distinct().collect(Collectors.toList());
for (InsuranceRegisterInvoiceNoParam param : collect) {
param.setFlag(CommonConstants.ONE_STRING);
// 必填校验
if (StringUtils.isBlank(param.getEmpName())){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
......@@ -3730,6 +3733,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
param.setErrorMessage(CommonConstants.RESULT_DATA_SUCESS);
param.setFlag(CommonConstants.ZERO_STRING);
//所有校验通过后设置查到的结果
param.setDetail(detail);
}
......@@ -3749,6 +3753,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
private List<InsuranceInsuredParam> updateInsuranceInsuredCheck(List<InsuranceInsuredParam> paramList, List<TInsuranceAreaRes> insuranceAreaResList){
List<InsuranceInsuredParam> collect = paramList.stream().distinct().collect(Collectors.toList());
for (InsuranceInsuredParam param : collect) {
param.setFlag(CommonConstants.ONE_STRING);
// 必填校验
if (StringUtils.isBlank(param.getEmpName())){
param.setErrorMessage(InsurancesConstants.EMP_NAME_NOT_EMPTY);
......@@ -3869,6 +3874,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
param.setErrorMessage(CommonConstants.RESULT_DATA_SUCESS);
param.setFlag(CommonConstants.ZERO_STRING);
//所有校验通过后设置查到的结果
param.setDetail(detail);
}
......@@ -6124,6 +6130,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
for (int i = 0; i < distinctList.size(); i++) {
InsuranceHandleImportParam param = distinctList.get(i);
//办理结果
param.setFlag(CommonConstants.ONE_STRING);
String handType = param.getHandType();
if(StringUtils.isBlank(handType)){
param.setErrorMessage(InsurancesConstants.HAND_RESULT_IS_EMPTY);
......@@ -6289,6 +6296,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
param.setId(detailId);
param.setErrorMessage(CommonConstants.RESULT_DATA_SUCESS);
param.setFlag(CommonConstants.ZERO_STRING);
}
return distinctList;
}
......
......@@ -48,7 +48,6 @@ public class TPaymentInfo extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@Schema(description ="主键")
private String id;
......
......@@ -72,6 +72,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import java.text.NumberFormat;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
......@@ -1427,8 +1428,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (Common.isNotNull(redisUtil.get(importSuccessKey))) {
redisUtil.remove(importSuccessKey);
}
//批量插入的集合
List<TPaymentInfo> batchInsertList = new ArrayList<>();
//养老插入的集合
ConcurrentHashMap<String,TPaymentInfo> batchYlInsertList = new ConcurrentHashMap<>();
//工伤插入的集合
ConcurrentHashMap<String,TPaymentInfo> batchGsInsertList = new ConcurrentHashMap<>();
//失业插入的集合
ConcurrentHashMap<String,TPaymentInfo> batchSyInsertList = new ConcurrentHashMap<>();
//医疗插入的集合
ConcurrentHashMap<String,TPaymentInfo> batchYyInsertList = new ConcurrentHashMap<>();
//获取所有项目信息
Map<String, TSettleDomainSelectVo> domainMap = this.getSelectVoMapById();
//地区数据
......@@ -1499,21 +1506,13 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTPaymentSocialHeFei(cachedDataList, errorMessageList, user, type, rowNumber, pensionMoneyMap,
importTPaymentSocialHeFei(cachedDataList, errorMessageList, type, rowNumber, pensionMoneyMap,
bigMoneyMap, unEmpMoneyMap, injuryMoneyMap, medicalMoneyMap, sumNumKey, importSuccessKey
, batchInsertList, areaMap, areaMap2,domainMap);
, batchGsInsertList,batchSyInsertList,batchYlInsertList,batchYyInsertList, areaMap,
areaMap2,domainMap);
log.info("存储数据库成功!");
}
}).sheet().doRead();
//批量插入数据
if (!batchInsertList.isEmpty()) {
this.saveBatch(batchInsertList);
batchInsertList.clear();
}
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
pensionMoneyMap.clear();
bigMoneyMap.clear();
unEmpMoneyMap.clear();
......@@ -1522,6 +1521,40 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
areaMap.clear();
areaMap2.clear();
domainMap.clear();
//批量插入数据
//养老
List<TPaymentInfo> list;
if (!batchYlInsertList.isEmpty()) {
list = new ArrayList<>(batchYlInsertList.values());
this.saveBatch(list);
batchYlInsertList.clear();
list.clear();
}
//工伤
if (!batchGsInsertList.isEmpty()) {
list = new ArrayList<>(batchGsInsertList.values());
this.saveBatch(list);
batchGsInsertList.clear();
list.clear();
}
//医疗
if (!batchYyInsertList.isEmpty()) {
list = new ArrayList<>(batchYyInsertList.values());
this.saveBatch(list);
batchYyInsertList.clear();
list.clear();
}
//失业
if (!batchSyInsertList.isEmpty()) {
list = new ArrayList<>(batchSyInsertList.values());
this.saveBatch(list);
batchSyInsertList.clear();
list.clear();
}
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return this.judgeAllMessage(errorMessageList);
}
......@@ -1777,16 +1810,23 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSettleDomainCode(domain.getDepartNo());
paymentInfo.setUnitId(domain.getCustomerId());
paymentInfo.setUnitName(domain.getCustomerName());
} else {
paymentInfo.setSettleDomainName("");
paymentInfo.setSettleDomainCode("");
paymentInfo.setUnitId("");
paymentInfo.setUnitName("");
}
paymentInfo.setFundProvince(tProvidentFund.getFundProvince());
paymentInfo.setFundCity(tProvidentFund.getFundCity());
paymentInfo.setFundTown(tProvidentFund.getFundTown());
paymentInfo.setProvidentHousehold(tProvidentFund.getProvidentHouseholdName());
}
if (Common.isNotNull(tProvidentFund)) {
paymentInfo.setInauguralTeam(tProvidentFund.getInauguralTeam());
paymentInfo.setInauguralTeam(Common.isNotNull(tProvidentFund.getInauguralTeam()) ? tProvidentFund.getInauguralTeam(): "");
paymentInfo.setEmpNo(tProvidentFund.getEmpNo());
} else {
paymentInfo.setInauguralTeam("");
paymentInfo.setEmpNo("");
}
paymentInfo.setProvidentPayMonth(infoVo.getProvidentPayMonth());
if (null != paymentInfo.getFundProvince()) {
......@@ -1808,6 +1848,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setProvidentPayAddr(paymentInfo.getProvidentPayAddr()
+ CommonConstants.CENTER_SPLIT_LINE_STRING + temp);
}
} else {
paymentInfo.setFundTown("");
}
paymentInfo.setProvidentCreateMonth(infoVo.getProvidentCreateMonth());
......@@ -1821,11 +1863,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
paymentInfo.setSumAll(paymentInfo.getProvidentSum());
paymentInfo.setFundId(UUID.randomUUID().toString());
batchInsertList.add(paymentInfo);
//批量插入数据
if (batchInsertList.size() >= 100000) {
this.saveBatch(batchInsertList);
batchInsertList.clear();
}
paymentInfoMap.put(paymentInfo.getProvidentPayAddr()
+ CommonConstants.DOWN_LINE_STRING
+ paymentInfo.getEmpIdcard().trim()
......@@ -1844,14 +1881,18 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
private void importTPaymentSocialHeFei(List<TPaymentHeFeiVo> list, List<ErrorDetailVO> errorMessageList,
YifuUser user, String type, Integer rowNumber,
String type, Integer rowNumber,
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap,
ConcurrentHashMap<String, BigDecimal> bigMoneyMap,
ConcurrentHashMap<String, BigDecimal> unEmpMoneyMap,
ConcurrentHashMap<String, BigDecimal> injuryMoneyMap,
ConcurrentHashMap<String, BigDecimal> medicalMoneyMap,
String sumNumKey, String importSuccessKey,
List<TPaymentInfo> batchInsertList,HashMap<String, String> areaMap,
ConcurrentHashMap<String,TPaymentInfo> batchGsInsertList,
ConcurrentHashMap<String,TPaymentInfo> batchSyInsertList,
ConcurrentHashMap<String,TPaymentInfo> batchYlInsertList,
ConcurrentHashMap<String,TPaymentInfo> batchYyInsertList,
HashMap<String, String> areaMap,
HashMap<String, String> areaMap2,Map<String,TSettleDomainSelectVo> domainMap) {
// 将以下代码提取出来,使用paymentInfoMap提升性能,避免list多次循环查询数据库浪费性能
......@@ -2006,8 +2047,6 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
// -----------------------------生成paymentInfoMap本段结束--------------------------------
// -----------------------------线程池处理list,批量保存社保信息开始--------------------------------
List<TPaymentHeFeiVo> tempList = new ArrayList<>();
List<CompletableFuture<List<ErrorDetailVO>>> completableFutureList = new ArrayList<>();
// 创建一个数值格式化对象
......@@ -2037,70 +2076,30 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
try {
// 1.list.size()不足partSize,直接执行
if (list.size() < partSize) {
if (list.size() < 100) {
CompletableFuture<List<ErrorDetailVO>> listCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, list, areaMap, areaMap2,
-> executeImportSocialListThree(list, areaMap, areaMap2,
paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap, paymentInfoInjuryMap,
paymentInfoBigMap, type, errorMessageList, pensionMoneyMap, bigMoneyMap,
unEmpMoneyMap, injuryMoneyMap, medicalMoneyMap,batchInsertList,domainMap),
unEmpMoneyMap, injuryMoneyMap, medicalMoneyMap, batchGsInsertList,
batchSyInsertList, batchYlInsertList, batchYyInsertList,domainMap),
yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
}
// 2.list.size()大于partSize,循环分批执行
int lastIdx = 0;
if (partSize <= list.size()) {
// 处理第一个0位元素
final List<TPaymentHeFeiVo> finalList = list.subList(0, 1);
CompletableFuture<List<ErrorDetailVO>> oneCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, finalList, areaMap,
areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap,
paymentInfoInjuryMap, paymentInfoBigMap, type,
errorMessageList, pensionMoneyMap, bigMoneyMap, unEmpMoneyMap, injuryMoneyMap,
medicalMoneyMap,batchInsertList,domainMap), yfSocialImportThreadPoolExecutor);
completableFutureList.add(oneCompletableFuture);
lastIdx = 1;
for (int i = 1; i < list.size(); i++) {
} else {
int j = 25;
for (int i = 0; i < 100; i = i + 25) {
// partSize数量的list为一个执行单元
tempList.add(list.get(i));
if (i % partSize == 0) {
lastIdx = i;
List<TPaymentHeFeiVo> finalTempList1 = tempList;
List<TPaymentHeFeiVo> finalTempList1 = list.subList(i,i+j);
CompletableFuture<List<ErrorDetailVO>> listCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, finalTempList1
-> executeImportSocialListThree(finalTempList1
, areaMap, areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap,
paymentInfoUnEmpMap, paymentInfoInjuryMap, paymentInfoBigMap, type,
errorMessageList, pensionMoneyMap, bigMoneyMap, unEmpMoneyMap,
injuryMoneyMap, medicalMoneyMap,batchInsertList,domainMap),
injuryMoneyMap, medicalMoneyMap, batchGsInsertList, batchSyInsertList,
batchYlInsertList, batchYyInsertList, domainMap),
yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
tempList = new ArrayList<>();
}
}
}
// 3.第2种方式执行完后,有余数的情况下,执行3
if (lastIdx != 0) {
tempList = new ArrayList<>();
if (lastIdx == 1) {
for (int i = lastIdx; i < list.size(); i++) {
tempList.add(list.get(i));
}
} else {
for (int i = lastIdx + 1; i < list.size(); i++) {
tempList.add(list.get(i));
}
lastIdx += 1;
}
List<TPaymentHeFeiVo> finalTempList = tempList;
CompletableFuture<List<ErrorDetailVO>> listCompletableFuture = CompletableFuture.supplyAsync(()
-> executeImportSocialListThree(user, finalTempList, areaMap,
areaMap2, paymentInfoPensionMap, paymentInfoMedicalMap, paymentInfoUnEmpMap,
paymentInfoInjuryMap, paymentInfoBigMap, type, errorMessageList, pensionMoneyMap,
bigMoneyMap, unEmpMoneyMap, injuryMoneyMap, medicalMoneyMap,batchInsertList,domainMap)
, yfSocialImportThreadPoolExecutor);
completableFutureList.add(listCompletableFuture);
}
// 阻塞当前线程,等待所有的线程执行完毕
......@@ -2114,15 +2113,24 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
} while (computeFlag);
paymentInfoBigMap.clear();
paymentInfoInjuryMap.clear();
paymentInfoUnEmpMap.clear();
paymentInfoPensionMap.clear();
paymentInfoMedicalMap.clear();
} catch (Exception e) {
log.error("社保缴费库数据批量导入异常:" + e);
paymentInfoBigMap.clear();
paymentInfoInjuryMap.clear();
paymentInfoUnEmpMap.clear();
paymentInfoPensionMap.clear();
paymentInfoMedicalMap.clear();
}
}
}
}
private List<ErrorDetailVO> executeImportSocialListThree(YifuUser user,
List<TPaymentHeFeiVo> list,
private List<ErrorDetailVO> executeImportSocialListThree(List<TPaymentHeFeiVo> list,
HashMap<String, String> areaMap,
HashMap<String, String> areaMap2,
ConcurrentHashMap<String, TPaymentInfo> paymentInfoPensionMap,
......@@ -2136,7 +2144,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
ConcurrentHashMap<String, BigDecimal> unEmpMoneyMap,
ConcurrentHashMap<String, BigDecimal> injuryMoneyMap,
ConcurrentHashMap<String, BigDecimal> medicalMoneyMap,
List<TPaymentInfo> batchInsertList,
ConcurrentHashMap<String, TPaymentInfo> batchGsInsertList,
ConcurrentHashMap<String, TPaymentInfo> batchSyInsertList,
ConcurrentHashMap<String, TPaymentInfo> batchYlInsertList,
ConcurrentHashMap<String, TPaymentInfo> batchYyInsertList,
Map<String,TSettleDomainSelectVo> domainMap) {
if (Common.isNotNull(list)) {
TPaymentInfo payExists;
......@@ -2154,8 +2165,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (Common.isNotNull(socialInfoList)) {
for (TSocialFundInfo tSocialInfo1 : socialInfoList) {
socialMap.put(tSocialInfo1.getEmpIdcard()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo1.getSocialCity()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo1.getSocialProvince()
+ CommonConstants.DOWN_LINE_STRING + tSocialInfo1.getSocialCity()
+ CommonConstants.DOWN_LINE_STRING + (null == tSocialInfo1.getSocialTown()
? "null" : tSocialInfo1.getSocialTown()), tSocialInfo1);
}
......@@ -2216,6 +2227,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
"的社保数据(请查验社保缴纳地)"));
continue;
}
} else {
tSocialInfo = null;
}
//判断是否存在养老缴费数据
......@@ -2225,7 +2238,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (pensionMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getPersonalMoney()), BigDecimalUtils.isNullToZero(
infoVo.getUnitMoney())), pensionMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "",
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的养老缴费数据"));
continue;
} else {
......@@ -2262,7 +2275,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (unEmpMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalMoney())), unEmpMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "",
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的失业缴费数据"));
continue;
} else {
......@@ -2300,7 +2313,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (medicalMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitMedicalMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalMedicalMoney())), medicalMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "",
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的医保缴费数据"));
continue;
} else {
......@@ -2340,7 +2353,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalMoney()),
BigDecimalUtils.isNullToZero(infoVo.getUnitMoney())),
injuryMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "",
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的工伤缴费数据"));
continue;
} else {
......@@ -2379,7 +2392,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getUnitBigailmentMoney()),
BigDecimalUtils.isNullToZero(infoVo.getPersonalBigailmentMoney())),
bigMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "", SocialConstants.ERROR_TEMPLATE +
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ZERO_INT, infoVo.getEmpIdcard(), "", "",
infoVo.getEmpName(), SocialConstants.ERROR_TEMPLATE + "的医疗救助金缴费数据"));
continue;
} else {
......@@ -2424,10 +2437,10 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setEmpIdcard(socialInfo.getEmpIdcard());
payExists.setEmpName(socialInfo.getEmpName());
payExists.setSettleDomainId(socialInfo.getSettleDomain());
payExists.setSettleDomainName(socialInfo.getSettleDomainName());
payExists.setSettleDomainCode(socialInfo.getSettleDomainCode());
payExists.setUnitId(socialInfo.getUnitId());
payExists.setUnitName(socialInfo.getUnitName());
payExists.setSettleDomainCode(Common.isNotNull(socialInfo.getSettleDomainCode()) ? socialInfo.getSettleDomainCode(): "");
payExists.setUnitId(Common.isNotNull(socialInfo.getUnitId()) ? socialInfo.getUnitId(): "");
payExists.setSettleDomainName(Common.isNotNull(socialInfo.getSettleDomainName()) ? socialInfo.getSettleDomainName(): "");
payExists.setUnitName(Common.isNotNull(socialInfo.getUnitName()) ? socialInfo.getUnitName(): "");
payExists.setSocialProvince(socialInfo.getSocialProvince());
payExists.setSocialCity(socialInfo.getSocialCity());
payExists.setSocialTown(socialInfo.getSocialTown());
......@@ -2447,6 +2460,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setSettleDomainCode(domain.getDepartNo());
payExists.setUnitId(domain.getCustomerId());
payExists.setUnitName(domain.getCustomerName());
} else {
payExists.setSettleDomainName("");
payExists.setSettleDomainCode("");
payExists.setUnitId("");
payExists.setUnitName("");
}
payExists.setSocialProvince(tSocialInfo.getSocialProvince());
payExists.setSocialCity(tSocialInfo.getSocialCity());
......@@ -2454,8 +2472,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setSocialHousehold(tSocialInfo.getSocialHouseholdName());
}
if (Common.isNotNull(tSocialInfo)) {
payExists.setInauguralTeam(tSocialInfo.getInauguralTeam());
payExists.setInauguralTeam(Common.isNotNull(tSocialInfo.getInauguralTeam()) ? tSocialInfo.getInauguralTeam(): "");
payExists.setEmpNo(tSocialInfo.getEmpNo());
} else {
payExists.setInauguralTeam("");
payExists.setEmpNo("");
}
payExists.setSocialPayMonth(infoVo.getSocialPayMonth());
......@@ -2476,9 +2497,14 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
if (Common.isNotNull(temp)) {
payExists.setSocialPayAddr(payExists.getSocialPayAddr() + CommonConstants.CENTER_SPLIT_LINE_STRING + temp);
}
} else {
payExists.setSocialTown("");
}
payExists.setSocialSecurityNo(infoVo.getSocialSecurityNo());
payExists.setSocialCreateMonth(infoVo.getSocialCreateMonth());
payExists.setSumAll(payExists.getSocialSum());
payExists.setCreateTime(LocalDateTime.now());
payExists.setSocialId(UUID.randomUUID().toString());
if (PaymentConstants.PENSION_RISK.equals(infoVo.getRiskType())) {
payExists.setUnitPensionMoney(infoVo.getUnitMoney());
payExists.setUnitPensionSet(infoVo.getUnitSet());
......@@ -2487,6 +2513,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
, payExists.getUnitSocialSum()));
payExists.setSocialSecurityPersonalSum(BigDecimalUtils.safeAdd(payExists.getPersonalPensionMoney()
, payExists.getSocialSecurityPersonalSum()));
payExists.setSocialSum(BigDecimalUtils.safeAdd(payExists.getUnitSocialSum(), payExists.getSocialSecurityPersonalSum()));
batchYlInsertList.put(UUID.randomUUID().toString(),payExists);
}
if (PaymentConstants.UNEMPLOYEEMENT_RISK.equals(infoVo.getRiskType())) {
payExists.setUnitUnemploymentMoney(infoVo.getUnitMoney());
......@@ -2496,12 +2524,16 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
, payExists.getUnitSocialSum()));
payExists.setSocialSecurityPersonalSum(BigDecimalUtils.safeAdd(payExists.getPersonalUnemploymentMoney()
, payExists.getSocialSecurityPersonalSum()));
payExists.setSocialSum(BigDecimalUtils.safeAdd(payExists.getUnitSocialSum(), payExists.getSocialSecurityPersonalSum()));
batchSyInsertList.put(UUID.randomUUID().toString(),payExists);
}
if (PaymentConstants.INJURY_RISK.equals(infoVo.getRiskType())) {
payExists.setUnitInjuryMoney(infoVo.getUnitMoney());
payExists.setUnitInjurySet(infoVo.getUnitSet());
payExists.setUnitSocialSum(BigDecimalUtils.safeAdd(payExists.getUnitInjuryMoney()
, payExists.getUnitSocialSum()));
payExists.setSocialSum(BigDecimalUtils.safeAdd(payExists.getUnitSocialSum(), payExists.getSocialSecurityPersonalSum()));
batchGsInsertList.put(UUID.randomUUID().toString(),payExists);
}
if (CommonConstants.ONE_STRING.equals(type)) {
payExists.setUnitMedicalMoney(infoVo.getUnitMedicalMoney());
......@@ -2517,18 +2549,15 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
payExists.setSocialSecurityPersonalSum(BigDecimalUtils.safeAdd(payExists.getPersonalMedicalMoney()
, payExists.getPersonalBigmailmentMoney()
, payExists.getSocialSecurityPersonalSum()));
}
payExists.setSocialSum(BigDecimalUtils.safeAdd(payExists.getUnitSocialSum(), payExists.getSocialSecurityPersonalSum()));
payExists.setSumAll(payExists.getSocialSum());
payExists.setCreateBy(user.getId());
payExists.setCreateName(user.getNickname());
payExists.setSocialId(UUID.randomUUID().toString());
batchInsertList.add(payExists);
//批量插入数据
if (batchInsertList.size() >= 50000) {
this.saveBatch(batchInsertList);
batchInsertList.clear();
batchYyInsertList.put(UUID.randomUUID().toString(),payExists);
}
errorMessageList.add(new ErrorDetailVO(infoVo.getRowIndex(), CommonConstants.ONE_INT,
infoVo.getEmpIdcard(),
payExists.getSocialHousehold(),
payExists.getProvidentHousehold(), infoVo.getEmpName(),
"对应员工身份证" + infoVo.getEmpIdcard() + CommonConstants.SAVE_SUCCESS,CommonConstants.GREEN));
continue;
}
}
return errorMessageList;
......
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