社保福利编辑保存改造

This commit is contained in:
Harryxzy 2024-05-17 09:40:52 +08:00
parent 216a2c67d3
commit b76a87b125
4 changed files with 142 additions and 62 deletions

View File

@ -813,6 +813,7 @@ public class SIArchivesBiz {
.paymentOrganization(param.getPaymentOrganization())
.build();
StringBuilder errorMsg = new StringBuilder("");
if (oldOtherInfoList.size() == 1) {
InsuranceArchivesOtherSchemePO oldOtherInfo = oldOtherInfoList.get(0);
//设置福利档案基数调整记录数据
@ -839,15 +840,17 @@ public class SIArchivesBiz {
.otherPaymentBaseString(paramReq.getPaymentForm())
.build();
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
throw new SalaryRunTimeException("其他福利个人:" + errorMsg.toString());
}
//需要拆分个人和公司福利基数时
if (welBaseDiffSign) {
updateOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm());
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg)) {
// throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
throw new SalaryRunTimeException("其他福利公司:" + errorMsg.toString());
}
}
encryptUtil.encrypt(updateOtherInfo, InsuranceArchivesOtherSchemePO.class);
@ -884,15 +887,17 @@ public class SIArchivesBiz {
.otherPaymentBaseString(paramReq.getPaymentForm())
.build();
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
throw new SalaryRunTimeException("其他福利个人:" + errorMsg.toString());
}
//需要拆分个人和公司福利基数时
if (welBaseDiffSign) {
insertOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm());
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg)) {
// throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
throw new SalaryRunTimeException("其他福利公司:" + errorMsg.toString());
}
}
encryptUtil.encrypt(insertOtherInfo, InsuranceArchivesOtherSchemePO.class);
@ -959,6 +964,7 @@ public class SIArchivesBiz {
.paymentOrganization(param.getPaymentOrganization())
.build();
StringBuilder errorMsg = new StringBuilder("");
if (oldFundInfoList.size() == 1) {
InsuranceArchivesFundSchemePO oldFundInfo = oldFundInfoList.get(0);
//设置福利档案基数调整记录数据
@ -986,15 +992,17 @@ public class SIArchivesBiz {
.employeeId(param.getEmployeeId())
.build();
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
throw new SalaryRunTimeException("公积金个人:" + errorMsg.toString());
}
//需要拆分个人和公司福利基数时
if (welBaseDiffSign) {
updateFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm());
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg)) {
// throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
throw new SalaryRunTimeException("公积金公司:" + errorMsg.toString());
}
}
encryptUtil.encrypt(updateFundInfo, InsuranceArchivesFundSchemePO.class);
@ -1033,15 +1041,17 @@ public class SIArchivesBiz {
.employeeId(param.getEmployeeId())
.build();
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
throw new SalaryRunTimeException("公积金个人:" + errorMsg.toString());
}
//需要拆分个人和公司福利基数时
if (welBaseDiffSign) {
insertFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm());
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg)) {
// throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
throw new SalaryRunTimeException("公积金公司:" + errorMsg.toString());
}
}
encryptUtil.encrypt(insertFundInfo, InsuranceArchivesFundSchemePO.class);
@ -1115,6 +1125,7 @@ public class SIArchivesBiz {
.paymentOrganization(param.getPaymentOrganization())
.build();
StringBuilder errorMsg = new StringBuilder();
//组装新数据
if (oldSocialInfoList.size() == 1) {
//老数据
@ -1144,15 +1155,17 @@ public class SIArchivesBiz {
.paymentOrganization(param.getPaymentOrganization())
.build();
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
throw new SalaryRunTimeException("社保个人:" + errorMsg.toString());
}
//需要拆分个人和公司福利基数时
if (welBaseDiffSign) {
updateSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm());
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg)) {
// throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
throw new SalaryRunTimeException("社保公司:" + errorMsg.toString());
}
}
encryptUtil.encrypt(updateSocialInfo, InsuranceArchivesSocialSchemePO.class);
@ -1191,15 +1204,17 @@ public class SIArchivesBiz {
.paymentOrganization(param.getPaymentOrganization())
.build();
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
throw new SalaryRunTimeException("社保个人:" + errorMsg.toString());
}
//需要拆分个人和公司福利基数时
if (welBaseDiffSign) {
insertSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm());
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg)) {
// throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!");
throw new SalaryRunTimeException("社保公司:" + errorMsg.toString());
}
}
encryptUtil.encrypt(insertSocialInfo, InsuranceArchivesSocialSchemePO.class);
@ -1239,7 +1254,7 @@ public class SIArchivesBiz {
* @param paymentBaseString
* @return
*/
public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope) {
public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope, StringBuilder errorMsg) {
if (primaryId ==null || paymentBaseString == null) {
return true;
@ -1255,6 +1270,7 @@ public class SIArchivesBiz {
if (entry.getValue() == null || entry.getValue().length() == 0) {
continue;
} else if (!isNumeric(entry.getValue())) {
errorMsg.append("福利值非数字");
log.info("福利值非数字!");
return false;
}
@ -1263,6 +1279,7 @@ public class SIArchivesBiz {
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOList = getInsuranceSchemeDetailMapper().getByPI(primaryId, Long.valueOf(entry.getKey()));
log.info("福利方案id: {},, 福利明细项id{}", primaryId, Long.valueOf(entry.getKey()));
if (insuranceSchemeDetailPOList.size() == 0) {
errorMsg.append("根据福利方案id、险种id、缴纳对象查询明细为null福利方案id: " + primaryId + ", 福利明细项id" + Long.valueOf(entry.getKey()));
log.info("根据福利方案id、险种id、缴纳对象查询明细为null福利方案id: {}, 福利明细项id{}", primaryId, Long.valueOf(entry.getKey()));
return false;
}
@ -1276,11 +1293,13 @@ public class SIArchivesBiz {
String upperLimit = "0.000".equals(insuranceSchemeDetailPO.getUpperLimit()) ? null : insuranceSchemeDetailPO.getUpperLimit();
if (lowerLimit != null && lowerLimit.length() > 0 && Double.parseDouble(entry.getValue()) < Double.parseDouble(lowerLimit)) {
//数值低于对应福利明细下限
errorMsg.append("基数:"+ entry.getKey() + " 数值:" + entry.getValue() +"低于对应福利明细下限:" + lowerLimit);
log.info("社保基数 {} 数值 {} 低于对应福利明细下限 {}", entry.getKey(), entry.getValue(), lowerLimit);
return false;
}
if (upperLimit != null && upperLimit.length() > 0 && Double.parseDouble(entry.getValue()) > Double.parseDouble(upperLimit)) {
//数值高于对应福利明细上限
errorMsg.append("基数:"+ entry.getKey() + " 数值:" + entry.getValue() +"高于对应福利明细上限:" + upperLimit);
log.info("社保基数 {} 数值 {} 高于对应福利明细上限 {} ", entry.getKey(), entry.getValue(), upperLimit);
return false;
}

View File

@ -141,7 +141,7 @@ public interface SIArchivesService {
Map<Long, InsuranceArchivesAccountPO> buildBatchAccount(List<Long> ids, Long paymentOrganization);
Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope);
Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope, StringBuilder errorMsg);
String adaptWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope);

View File

@ -169,6 +169,10 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
return MapperProxyFactory.getProxy(InsuranceBaseAdjustHistoryMapper.class);
}
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
@Override
public Map<String, Object> getTips(Map<String, Object> params) {
@ -2843,6 +2847,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
.paymentOrganization(param.getPaymentOrganization())
.build();
String combineErrorMsg = "";
if (oldOtherInfoList.size() == 1) {
InsuranceArchivesOtherSchemePO oldOtherInfo = oldOtherInfoList.get(0);
//设置福利档案基数调整记录数据
@ -2877,8 +2882,10 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
updateOtherInfo.setOtherPaymentBaseString(otherPaymentBaseString);
}
} else {
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "其他福利个人: " + errorMsg;
}
}
//需要拆分个人和公司福利基数时
@ -2892,11 +2899,16 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
updateOtherInfo.setOtherPaymentComBaseString(otherPaymentComBaseString);
}
} else {
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg += "其他福利公司:" + errorMsg;
}
}
}
if (StringUtils.isNotBlank(combineErrorMsg)) {
throw new SalaryRunTimeException(combineErrorMsg);
}
encryptUtil.encrypt(updateOtherInfo, InsuranceArchivesOtherSchemePO.class);
getOtherSchemeMapper().updateById(updateOtherInfo);
//更新base_info表状态
@ -2941,8 +2953,10 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
insertOtherInfo.setOtherPaymentBaseString(otherPaymentBaseString);
}
} else {
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "其他福利个人:" + errorMsg;
}
}
//需要拆分个人和公司福利基数时
@ -2955,12 +2969,17 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
insertOtherInfo.setOtherPaymentComBaseString(otherPaymentComBaseString);
}
} else {
StringBuilder errorMsg = new StringBuilder("");
//校验福利基数是否符合上下限要求
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg += "其他福利公司:" + errorMsg;
}
}
}
if (StringUtils.isNotBlank(combineErrorMsg)) {
throw new SalaryRunTimeException(combineErrorMsg);
}
encryptUtil.encrypt(insertOtherInfo, InsuranceArchivesOtherSchemePO.class);
getOtherSchemeMapper().insert(insertOtherInfo);
@ -3038,6 +3057,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
.paymentOrganization(param.getPaymentOrganization())
.build();
String combineErrorMsg = "";
if (oldFundInfoList.size() == 1) {
InsuranceArchivesFundSchemePO oldFundInfo = oldFundInfoList.get(0);
//设置福利档案基数调整记录数据
@ -3073,8 +3093,10 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
updateFundInfo.setFundPaymentBaseString(fundPaymentBaseString);
}
} else {
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "公积金个人" + errorMsg;
}
}
@ -3089,11 +3111,18 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
updateFundInfo.setFundPaymentComBaseString(fundPaymentComBaseString);
}
} else {
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg += "公积金公司:" + errorMsg;
}
}
}
if (StringUtils.isNotBlank(combineErrorMsg)) {
throw new SalaryRunTimeException(combineErrorMsg);
}
encryptUtil.encrypt(updateFundInfo, InsuranceArchivesFundSchemePO.class);
getFundSchemeMapper().updateById(updateFundInfo);
//更新base_info表状态
@ -3140,8 +3169,10 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
insertFundInfo.setFundPaymentBaseString(fundPaymentBaseString);
}
} else {
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "公积金个人:" + errorMsg;
}
}
@ -3156,11 +3187,16 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
insertFundInfo.setFundPaymentComBaseString(fundPaymentComBaseString);
}
} else {
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg += "公积金公司:" + errorMsg;
}
}
}
if (StringUtils.isNotBlank(combineErrorMsg)) {
throw new SalaryRunTimeException(combineErrorMsg);
}
encryptUtil.encrypt(insertFundInfo, InsuranceArchivesFundSchemePO.class);
getFundSchemeMapper().insert(insertFundInfo);
@ -3240,6 +3276,8 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
.employeeId(param.getEmployeeId())
.paymentOrganization(param.getPaymentOrganization())
.build();
String combineErrorMsg = "";
//组装新数据
if (oldSocialInfoList.size() == 1) {
//老数据
@ -3277,8 +3315,10 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
updateSocialInfo.setSocialPaymentBaseString(socialPaymentBaseString);
}
} else {
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "社保个人:" + errorMsg;
}
}
@ -3293,11 +3333,17 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
updateSocialInfo.setSocialPaymentComBaseString(socialPaymentComBaseString);
}
} else {
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg += "社保公司:" + errorMsg;
}
}
}
if (StringUtils.isNotBlank(combineErrorMsg)) {
throw new SalaryRunTimeException(combineErrorMsg);
}
encryptUtil.encrypt(updateSocialInfo, InsuranceArchivesSocialSchemePO.class);
getSocialSchemeMapper().updateById(updateSocialInfo);
//更新base_info表状态
@ -3344,8 +3390,10 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
insertSocialInfo.setSocialPaymentBaseString(socialPaymentBaseString);
}
} else {
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "社保个人:" + errorMsg;
}
}
//需要拆分个人和公司福利基数时
@ -3359,11 +3407,16 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
insertSocialInfo.setSocialPaymentComBaseString(socialPaymentComBaseString);
}
} else {
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg)) {
combineErrorMsg += "社保公司:" + errorMsg;
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
}
}
}
if (StringUtils.isNotBlank(combineErrorMsg)) {
throw new SalaryRunTimeException(combineErrorMsg);
}
encryptUtil.encrypt(insertSocialInfo, InsuranceArchivesSocialSchemePO.class);
getSocialSchemeMapper().insert(insertSocialInfo);
@ -3415,7 +3468,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
* @return
*/
@Override
public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope) {
public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope, StringBuilder errorMsg) {
if (primaryId ==null || paymentBaseString == null) {
return true;
@ -3424,23 +3477,28 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (paymentBaseJson == null) {
return true;
}
List<ICategoryPO> iCategoryPOS = getICategoryMapper().listAll();
Map<String, String> categoryMap = SalaryEntityUtil.convert2Map(iCategoryPOS, po -> po.getId().toString(), ICategoryPO::getInsuranceName);
Boolean flag = true;
for (Map.Entry<String, String> entry : paymentBaseJson.entrySet()) {
//判断福利值是否为空/数字
if (entry.getValue() == null || entry.getValue().length() == 0) {
continue;
} else if (!isNumeric(entry.getValue())) {
errorMsg.append("福利值非数字");
log.info("福利值非数字!");
return false;
flag = false;
}
//根据福利方案id险种id缴纳对象缴费状态查询明细
List<InsuranceSchemeDetailPO> insuranceSchemeDetailPOList = getInsuranceSchemeDetailMapper().getByPI(primaryId, Long.valueOf(entry.getKey()));
log.info("福利方案id: {},, 福利明细项id{}", primaryId, Long.valueOf(entry.getKey()));
if (insuranceSchemeDetailPOList.size() == 0) {
errorMsg.append("根据福利方案id、险种id、缴纳对象查询明细为null福利方案id: " + primaryId + ", 福利明细项id" + Long.valueOf(entry.getKey()) + "");
log.info("根据福利方案id、险种id、缴纳对象查询明细为null福利方案id: {}, 福利明细项id{}", primaryId, Long.valueOf(entry.getKey()));
return false;
flag = false;
}
List<InsuranceSchemeDetailPO> isPaymentList = insuranceSchemeDetailPOList.stream()
.filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList());
@ -3452,13 +3510,15 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
String upperLimit = "0.000".equals(insuranceSchemeDetailPO.getUpperLimit()) ? null : insuranceSchemeDetailPO.getUpperLimit();
if (lowerLimit != null && lowerLimit.length() > 0 && Double.parseDouble(entry.getValue()) < Double.parseDouble(lowerLimit)) {
//数值低于对应福利明细下限
errorMsg.append(""+ categoryMap.getOrDefault(entry.getKey(), "") + "】数值: " + entry.getValue() +",低于对应福利明细下限: " + lowerLimit+ "\n");
log.info("社保基数 {} 数值 {} 低于对应福利明细下限 {}", entry.getKey(), entry.getValue(), lowerLimit);
return false;
flag = false;
}
if (upperLimit != null && upperLimit.length() > 0 && Double.parseDouble(entry.getValue()) > Double.parseDouble(upperLimit)) {
//数值高于对应福利明细上限
errorMsg.append(""+ categoryMap.getOrDefault(entry.getKey(), "") + "】数值: " + entry.getValue() +",高于对应福利明细上限: " + upperLimit+ "\n");
log.info("社保基数 {} 数值 {} 高于对应福利明细上限 {} ", entry.getKey(), entry.getValue(), upperLimit);
return false;
flag = false;
}
} else {
log.info("福利明细项属于未缴费状态,不对上下限进行约束");
@ -3466,7 +3526,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
}
return true;
return flag;
}
/**

View File

@ -1407,24 +1407,25 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
boolean welBaseAutoAdjustSign = welBaseAutoAdjust != null && welBaseAutoAdjust.getConfValue().equals(OpenEnum.OPEN.getValue());
if (!isError && !welBaseAutoAdjustSign) {
StringBuilder errorMsg = new StringBuilder("");
insuranceArchivesAccountPO.setSocial(insuranceArchivesSocialSchemePO);
insuranceArchivesAccountPO.setFund(insuranceArchivesFundSchemePO);
insuranceArchivesAccountPO.setOther(insuranceArchivesOtherSchemePO);
insuranceArchivesAccountPO.setBaseInfo(insuranceArchivesBaseInfoPO);
//校验福利基数是否符合上下限要求
Boolean socialCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
Boolean socialCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg);
Boolean fundCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
Boolean fundCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg);
Boolean otherCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
Boolean otherCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg);
Boolean socialCheckComBase = true;
Boolean fundCheckComBase = true;
Boolean otherCheckComBase = true;
if (welBaseDiffSign) {
socialCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
fundCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
otherCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
socialCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
fundCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
otherCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
}
if (socialCheckBase && fundCheckBase && otherCheckBase && socialCheckComBase && fundCheckComBase && otherCheckComBase) {
insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO);