Commit 235ca7f3 authored by huyuchen's avatar huyuchen

权限导出问题修改

parent 3d51b57d
......@@ -8,10 +8,7 @@ package com.yifu.cloud.plus.v1.yifu.social.constants;
public class PaymentConstants {
public static final String PENSION_RISK = "养老保险";
public static final String PENSION = "养老";
public static final String UNEMPLOYEEMENT_RISK = "失业保险";
public static final String UNEMPLOYEEMENT = "失业";
public static final String INJURY_RISK = "工伤保险";
public static final String INJURY = "工伤";
public static final String MEDICAL = "医疗";
}
......@@ -12,6 +12,8 @@ public class SocialConstants {
public static final String DIFF_TYPE_ONE = "预估";
public static final String DIFF_TYPE_THR = "实缴";
public static final String DIFF_TYPE_TWO = "差额";
public static final String ERROR_TEMPLATE = "模板中已存在对应员工";
public static final String EXIT_TEMPLATE = "已存在对应员工身份证";
public static final String YL = "养老";
public static final String DB = "大病";
......
......@@ -760,6 +760,19 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
String temp;
int res;
//养老
ConcurrentHashMap<String, BigDecimal> pensionMoneyMap = new ConcurrentHashMap<>();
//大病救助金
ConcurrentHashMap<String, BigDecimal> bigMoneyMap = new ConcurrentHashMap<>();
//失业
ConcurrentHashMap<String, BigDecimal> unEmpMoneyMap = new ConcurrentHashMap<>();
//生育
ConcurrentHashMap<String, BigDecimal> birMoneyMap = new ConcurrentHashMap<>();
//工伤
ConcurrentHashMap<String, BigDecimal> injuryMoneyMap = new ConcurrentHashMap<>();
//医保
ConcurrentHashMap<String, BigDecimal> medicalMoneyMap = new ConcurrentHashMap<>();
List<TSocialFundInfo> socialInfoList = socialFundInfoMapper.selectList(Wrappers.<TSocialFundInfo>query().lambda()
.in(TSocialFundInfo::getEmpIdcard, Common.listObjectToStrList(list, ExcelAttributeConstants.EMPIDCARD)));
......@@ -776,7 +789,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
}
String[] areaArray;
String exitMoney;
for (TPaymentInfoVo infoVo : list) {
if (Common.isNotNull(infoVo.getEmpIdcard())) {
infoVo.setEmpIdcard(infoVo.getEmpIdcard().replace("x", "X"));
......@@ -819,10 +832,77 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
continue;
}
//查看缴纳月是否为空
if (!Common.isNotNull(infoVo.getSocialPayMonth())) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "必填项校验失败:社保缴纳月份不可为空!"));
//导入模板判重 养老
exitMoney = infoVo.getEmpIdcard().concat(infoVo.getSocialPayMonth().concat(socialInfo.getSettleDomainCode()).concat(SocialConstants.YL));
if (pensionMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitPensionMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalPensionMoney())), pensionMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() + "的养老缴费数据"));
continue;
} else {
pensionMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(BigDecimalUtils.isNullToZero(infoVo.getUnitPensionMoney()),
BigDecimalUtils.isNullToZero(infoVo.getPersonalPensionMoney())));
}
//医疗
exitMoney = infoVo.getEmpIdcard().concat(infoVo.getSocialPayMonth().concat(socialInfo.getSettleDomainCode()).concat(SocialConstants.YB));
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 ErrorMessage(infoVo.getRowIndex(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() + "的医保缴费数据"));
continue;
} else {
medicalMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitMedicalMoney()),
BigDecimalUtils.isNullToZero(infoVo.getPersonalMedicalMoney())));
}
//失业
exitMoney = infoVo.getEmpIdcard().concat(infoVo.getSocialPayMonth().concat(socialInfo.getSettleDomainCode()).concat(SocialConstants.SY));
if (unEmpMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitUnemploymentMoney()), BigDecimalUtils.isNullToZero(
infoVo.getPersonalUnemploymentMoney())), unEmpMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() + "的失业缴费数据"));
continue;
} else {
unEmpMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitUnemploymentMoney()),
BigDecimalUtils.isNullToZero(infoVo.getPersonalUnemploymentMoney())));
}
//工伤
exitMoney = infoVo.getEmpIdcard().concat(infoVo.getSocialPayMonth().concat(socialInfo.getSettleDomainCode()).concat(SocialConstants.GS));
if (injuryMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.isNullToZero(infoVo.getUnitInjuryMoney()),
injuryMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() + "的工伤缴费数据"));
continue;
} else {
injuryMoneyMap.put(exitMoney, BigDecimalUtils.isNullToZero(infoVo.getUnitInjuryMoney()));
}
//生育
exitMoney = infoVo.getEmpIdcard().concat(infoVo.getSocialPayMonth().concat(socialInfo.getSettleDomainCode()).concat(SocialConstants.BIR));
if (birMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.isNullToZero(infoVo.getUnitBirthMoney()),
birMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() + "的生育缴费数据"));
continue;
} else {
birMoneyMap.put(exitMoney, BigDecimalUtils.isNullToZero(infoVo.getUnitBirthMoney()));
}
//医疗救助金
exitMoney = infoVo.getEmpIdcard().concat(infoVo.getSocialPayMonth().concat(socialInfo.getSettleDomainCode()).concat(SocialConstants.DB));
if (bigMoneyMap.get(exitMoney) != null && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitBigmailmentMoney()),
BigDecimalUtils.isNullToZero(infoVo.getPersonalBigmailmentMoney())),
bigMoneyMap.get(exitMoney)).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.ERROR_TEMPLATE +
infoVo.getEmpIdcard() + "的医疗救助金缴费数据"));
continue;
} else {
bigMoneyMap.put(exitMoney, BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitBigmailmentMoney()),
BigDecimalUtils.isNullToZero(infoVo.getPersonalBigmailmentMoney())));
}
//判断是否存在养老缴费数据
......@@ -844,7 +924,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalPensionMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(paymentInfo.getUnitPensionMoney()),
BigDecimalUtils.isNullToZero(paymentInfo.getPersonalPensionMoney()))).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.EXIT_TEMPLATE + infoVo.getEmpIdcard()
+ "的养老缴费数据,请勿重复导入!"));
continue;
}
......@@ -868,7 +948,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalUnemploymentMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(paymentInfo.getUnitUnemploymentMoney()),
BigDecimalUtils.isNullToZero(paymentInfo.getPersonalUnemploymentMoney()))).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.EXIT_TEMPLATE + infoVo.getEmpIdcard()
+ "的失业缴费数据,请勿重复导入!"));
continue;
}
......@@ -893,7 +973,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalMedicalMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(paymentInfo.getUnitMedicalMoney()),
BigDecimalUtils.isNullToZero(paymentInfo.getPersonalMedicalMoney()))).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.EXIT_TEMPLATE + infoVo.getEmpIdcard()
+ "的医保缴费数据,请勿重复导入!"));
continue;
}
......@@ -917,7 +997,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalBigmailmentMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(paymentInfo.getUnitBigmailmentMoney()),
BigDecimalUtils.isNullToZero(paymentInfo.getPersonalBigmailmentMoney()))).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.EXIT_TEMPLATE + infoVo.getEmpIdcard()
+ "的医疗救助金缴费数据,请勿重复导入!"));
continue;
}
......@@ -937,7 +1017,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//存在社保缴费数据
if (null != paymentInfo && BigDecimalUtils.safeMultiply(BigDecimalUtils.isNullToZero(infoVo.getUnitInjuryMoney()),
BigDecimalUtils.isNullToZero(paymentInfo.getUnitInjuryMoney())).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.EXIT_TEMPLATE + infoVo.getEmpIdcard()
+ "的单位工伤缴费数据,请勿重复导入!"));
continue;
}
......@@ -957,7 +1037,7 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//存在社保缴费数据
if (null != paymentInfo && BigDecimalUtils.safeMultiply(BigDecimalUtils.isNullToZero(infoVo.getUnitBirthMoney()),
BigDecimalUtils.isNullToZero(paymentInfo.getUnitBirthMoney())).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.EXIT_TEMPLATE + infoVo.getEmpIdcard()
+ "的单位生育缴费数据,请勿重复导入!"));
continue;
}
......@@ -1725,8 +1805,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getUnitMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(payExists.getUnitPensionMoney()),
BigDecimalUtils.isNullToZero(payExists.getPersonalPensionMoney()))).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的养老缴费数据,请勿重复导入!"));
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.EXIT_TEMPLATE
+ infoVo.getEmpIdcard() + "的养老缴费数据,请勿重复导入!"));
continue;
}
}
......@@ -1748,8 +1828,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getUnitMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(payExists.getUnitUnemploymentMoney()),
BigDecimalUtils.isNullToZero(payExists.getPersonalUnemploymentMoney()))).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的失业缴费数据,请勿重复导入!"));
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.EXIT_TEMPLATE
+ infoVo.getEmpIdcard() + "的失业缴费数据,请勿重复导入!"));
continue;
}
}
......@@ -1772,8 +1852,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalMedicalMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(payExists.getUnitMedicalMoney()),
BigDecimalUtils.isNullToZero(payExists.getPersonalMedicalMoney()))).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的医保缴费数据,请勿重复导入!"));
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.EXIT_TEMPLATE
+ infoVo.getEmpIdcard() + "的医保缴费数据,请勿重复导入!"));
continue;
}
}
......@@ -1792,11 +1872,11 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
//存在社保缴费数据
if (null != payExists && BigDecimalUtils.safeMultiply(BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(infoVo.getUnitMedicalMoney()),
BigDecimalUtils.isNullToZero(infoVo.getPersonalMedicalMoney())),
BigDecimalUtils.isNullToZero(infoVo.getPersonalMoney()),
BigDecimalUtils.isNullToZero(infoVo.getUnitMoney())),
BigDecimalUtils.isNullToZero(payExists.getUnitInjuryMoney())).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的单位工伤缴费数据,请勿重复导入!"));
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.EXIT_TEMPLATE
+ infoVo.getEmpIdcard() + "的单位工伤缴费数据,请勿重复导入!"));
continue;
}
}
......@@ -1819,8 +1899,8 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
BigDecimalUtils.isNullToZero(infoVo.getPersonalBigailmentMoney())), BigDecimalUtils.safeAdd(
BigDecimalUtils.isNullToZero(payExists.getUnitBigmailmentMoney()),
BigDecimalUtils.isNullToZero(payExists.getPersonalBigmailmentMoney()))).compareTo(BigDecimal.ZERO) > 0) {
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), "已存在对应员工身份证" + infoVo.getEmpIdcard()
+ "的医疗救助金缴费数据,请勿重复导入!"));
errorMessageList.add(new ErrorMessage(infoVo.getRowIndex(), SocialConstants.EXIT_TEMPLATE
+ infoVo.getEmpIdcard() + "的医疗救助金缴费数据,请勿重复导入!"));
continue;
}
}
......
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