Merge branch 'fix/240302-社保福利编辑保存改造' into release/2.14.2.2405.02
This commit is contained in:
commit
bf50976849
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,4 +25,9 @@ public class InsuranceArchivesSaveParam {
|
|||
private String paymentForm;
|
||||
|
||||
private String paymentComForm;
|
||||
|
||||
/**
|
||||
* 是否修改数据为上限或下限
|
||||
*/
|
||||
private Boolean changeData;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam;
|
|||
import com.engine.salary.entity.siarchives.param.SIArchiveBaseHistoryListParam;
|
||||
import com.engine.salary.entity.siarchives.po.*;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
|
|
@ -141,7 +141,9 @@ 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);
|
||||
|
||||
String checkAndBuildWelBaseWithLimit(Long primaryId, String paymentBaseString, Integer paymentScope);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,11 +16,11 @@ import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
|||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.cmd.siarchives.SIArchivesTipsCmd;
|
||||
import com.engine.salary.common.SalaryContext;
|
||||
import com.engine.salary.config.SalaryElogConfig;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.hrmelog.entity.dto.LoggerContext;
|
||||
import com.engine.salary.encrypt.EncryptUtil;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.siarchives.bo.InsuranceArchivesBO;
|
||||
|
|
@ -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);
|
||||
//设置福利档案基数调整记录数据
|
||||
|
|
@ -2870,17 +2875,40 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
.otherPaymentBaseString(paramReq.getPaymentForm())
|
||||
.build();
|
||||
//校验福利基数是否符合上下限要求,
|
||||
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
if (paramReq.getChangeData() != null && paramReq.getChangeData()) {
|
||||
// 将不满足上下限基数修改为上限或下限
|
||||
String otherPaymentBaseString = adaptWelBaseLimit(updateOtherInfo.getOtherSchemeId(), updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
if (otherPaymentBaseString != null) {
|
||||
updateOtherInfo.setOtherPaymentBaseString(otherPaymentBaseString);
|
||||
}
|
||||
} else {
|
||||
StringBuilder errorMsg = new StringBuilder("");
|
||||
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
combineErrorMsg = "其他福利个人: " + errorMsg;
|
||||
}
|
||||
}
|
||||
//需要拆分个人和公司福利基数时
|
||||
if (welBaseDiffSign) {
|
||||
updateOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm());
|
||||
//校验福利基数是否符合上下限要求
|
||||
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
if (paramReq.getChangeData() != null && paramReq.getChangeData()) {
|
||||
// 将不满足上下限基数修改为上限或下限
|
||||
String otherPaymentComBaseString = adaptWelBaseLimit(updateOtherInfo.getOtherSchemeId(), updateOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
if (otherPaymentComBaseString != null) {
|
||||
updateOtherInfo.setOtherPaymentComBaseString(otherPaymentComBaseString);
|
||||
}
|
||||
} else {
|
||||
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表状态
|
||||
|
|
@ -2918,17 +2946,40 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
.otherPaymentBaseString(paramReq.getPaymentForm())
|
||||
.build();
|
||||
//校验福利基数是否符合上下限要求,
|
||||
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
if (paramReq.getChangeData() != null && paramReq.getChangeData()) {
|
||||
// 将不满足上下限基数修改为上限或下限
|
||||
String otherPaymentBaseString = adaptWelBaseLimit(insertOtherInfo.getOtherSchemeId(), insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
if (otherPaymentBaseString != null) {
|
||||
insertOtherInfo.setOtherPaymentBaseString(otherPaymentBaseString);
|
||||
}
|
||||
} else {
|
||||
StringBuilder errorMsg = new StringBuilder("");
|
||||
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
combineErrorMsg = "其他福利个人:" + errorMsg;
|
||||
}
|
||||
}
|
||||
//需要拆分个人和公司福利基数时
|
||||
if (welBaseDiffSign) {
|
||||
insertOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm());
|
||||
//校验福利基数是否符合上下限要求
|
||||
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
if (paramReq.getChangeData() != null && paramReq.getChangeData()) {
|
||||
// 将不满足上下限基数修改为上限或下限
|
||||
String otherPaymentComBaseString = adaptWelBaseLimit(insertOtherInfo.getOtherSchemeId(), insertOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
if (otherPaymentComBaseString != null) {
|
||||
insertOtherInfo.setOtherPaymentComBaseString(otherPaymentComBaseString);
|
||||
}
|
||||
} else {
|
||||
StringBuilder errorMsg = new StringBuilder("");
|
||||
//校验福利基数是否符合上下限要求
|
||||
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);
|
||||
|
||||
|
|
@ -3006,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);
|
||||
//设置福利档案基数调整记录数据
|
||||
|
|
@ -3034,17 +3086,43 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
.employeeId(param.getEmployeeId())
|
||||
.build();
|
||||
//校验福利基数是否符合上下限要求,
|
||||
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
if (paramReq.getChangeData() != null && paramReq.getChangeData()) {
|
||||
// 将不满足上下限基数修改为上限或下限
|
||||
String fundPaymentBaseString = adaptWelBaseLimit(updateFundInfo.getFundSchemeId(), updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
if (fundPaymentBaseString != null) {
|
||||
updateFundInfo.setFundPaymentBaseString(fundPaymentBaseString);
|
||||
}
|
||||
} else {
|
||||
StringBuilder errorMsg = new StringBuilder("");
|
||||
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
combineErrorMsg = "公积金个人" + errorMsg;
|
||||
}
|
||||
}
|
||||
|
||||
//需要拆分个人和公司福利基数时
|
||||
if (welBaseDiffSign) {
|
||||
updateFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm());
|
||||
//校验福利基数是否符合上下限要求
|
||||
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
if (paramReq.getChangeData() != null && paramReq.getChangeData()) {
|
||||
// 将不满足上下限基数修改为上限或下限
|
||||
String fundPaymentComBaseString = adaptWelBaseLimit(updateFundInfo.getFundSchemeId(), updateFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
if (fundPaymentComBaseString != null) {
|
||||
updateFundInfo.setFundPaymentComBaseString(fundPaymentComBaseString);
|
||||
}
|
||||
} else {
|
||||
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表状态
|
||||
|
|
@ -3084,17 +3162,41 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
.employeeId(param.getEmployeeId())
|
||||
.build();
|
||||
//校验福利基数是否符合上下限要求,
|
||||
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
if (paramReq.getChangeData() != null && paramReq.getChangeData()) {
|
||||
// 将不满足上下限基数修改为上限或下限
|
||||
String fundPaymentBaseString = adaptWelBaseLimit(insertFundInfo.getFundSchemeId(), insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
if (fundPaymentBaseString != null) {
|
||||
insertFundInfo.setFundPaymentBaseString(fundPaymentBaseString);
|
||||
}
|
||||
} else {
|
||||
StringBuilder errorMsg = new StringBuilder("");
|
||||
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
combineErrorMsg = "公积金个人:" + errorMsg;
|
||||
}
|
||||
}
|
||||
|
||||
//需要拆分个人和公司福利基数时
|
||||
if (welBaseDiffSign) {
|
||||
insertFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm());
|
||||
//校验福利基数是否符合上下限要求
|
||||
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
if (paramReq.getChangeData() != null && paramReq.getChangeData()) {
|
||||
// 将不满足上下限基数修改为上限或下限
|
||||
String fundPaymentComBaseString = adaptWelBaseLimit(insertFundInfo.getFundSchemeId(), insertFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
if (fundPaymentComBaseString != null) {
|
||||
insertFundInfo.setFundPaymentComBaseString(fundPaymentComBaseString);
|
||||
}
|
||||
} else {
|
||||
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);
|
||||
|
||||
|
|
@ -3174,6 +3276,8 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
.employeeId(param.getEmployeeId())
|
||||
.paymentOrganization(param.getPaymentOrganization())
|
||||
.build();
|
||||
|
||||
String combineErrorMsg = "";
|
||||
//组装新数据
|
||||
if (oldSocialInfoList.size() == 1) {
|
||||
//老数据
|
||||
|
|
@ -3204,17 +3308,42 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
.paymentOrganization(param.getPaymentOrganization())
|
||||
.build();
|
||||
//校验福利基数是否符合上下限要求
|
||||
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
if (paramReq.getChangeData() != null && paramReq.getChangeData()) {
|
||||
// 将不满足上下限基数修改为上限或下限
|
||||
String socialPaymentBaseString = adaptWelBaseLimit(updateSocialInfo.getSocialSchemeId(), updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
if (socialPaymentBaseString != null) {
|
||||
updateSocialInfo.setSocialPaymentBaseString(socialPaymentBaseString);
|
||||
}
|
||||
} else {
|
||||
StringBuilder errorMsg = new StringBuilder("");
|
||||
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
combineErrorMsg = "社保个人:" + errorMsg;
|
||||
}
|
||||
}
|
||||
|
||||
//需要拆分个人和公司福利基数时
|
||||
if (welBaseDiffSign) {
|
||||
updateSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm());
|
||||
//校验福利基数是否符合上下限要求
|
||||
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
if (paramReq.getChangeData() != null && paramReq.getChangeData()) {
|
||||
// 将不满足上下限基数修改为上限或下限
|
||||
String socialPaymentComBaseString = adaptWelBaseLimit(updateSocialInfo.getSocialSchemeId(), updateSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
if (socialPaymentComBaseString != null) {
|
||||
updateSocialInfo.setSocialPaymentComBaseString(socialPaymentComBaseString);
|
||||
}
|
||||
} else {
|
||||
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表状态
|
||||
|
|
@ -3254,17 +3383,40 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
.paymentOrganization(param.getPaymentOrganization())
|
||||
.build();
|
||||
//校验福利基数是否符合上下限要求
|
||||
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
if (paramReq.getChangeData() != null && paramReq.getChangeData()) {
|
||||
// 将不满足上下限基数修改为上限或下限
|
||||
String socialPaymentBaseString = adaptWelBaseLimit(insertSocialInfo.getSocialSchemeId(), insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue());
|
||||
if (socialPaymentBaseString != null) {
|
||||
insertSocialInfo.setSocialPaymentBaseString(socialPaymentBaseString);
|
||||
}
|
||||
} else {
|
||||
StringBuilder errorMsg = new StringBuilder("");
|
||||
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
|
||||
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
combineErrorMsg = "社保个人:" + errorMsg;
|
||||
}
|
||||
}
|
||||
//需要拆分个人和公司福利基数时
|
||||
if (welBaseDiffSign) {
|
||||
insertSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm());
|
||||
//校验福利基数是否符合上下限要求
|
||||
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
|
||||
if (paramReq.getChangeData() != null && paramReq.getChangeData()) {
|
||||
// 将不满足上下限基数修改为上限或下限
|
||||
String socialPaymentComBaseString = adaptWelBaseLimit(insertSocialInfo.getSocialSchemeId(), insertSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
|
||||
if (socialPaymentComBaseString != null) {
|
||||
insertSocialInfo.setSocialPaymentComBaseString(socialPaymentComBaseString);
|
||||
}
|
||||
} else {
|
||||
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);
|
||||
|
||||
|
|
@ -3316,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;
|
||||
|
|
@ -3325,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());
|
||||
|
|
@ -3353,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("福利明细项属于未缴费状态,不对上下限进行约束");
|
||||
|
|
@ -3367,7 +3526,67 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
|
||||
|
||||
}
|
||||
return true;
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验福利基数是否符合上下限要求
|
||||
* @param primaryId
|
||||
* @param paymentBaseString
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String adaptWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope) {
|
||||
|
||||
if (primaryId ==null || paymentBaseString == null) {
|
||||
return null;
|
||||
}
|
||||
Map<String, String> paymentBaseJson = JSON.parseObject(paymentBaseString, new HashMap<String, String>().getClass());
|
||||
if (paymentBaseJson == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (Map.Entry<String, String> entry : paymentBaseJson.entrySet()) {
|
||||
|
||||
//判断福利值是否为空/数字
|
||||
if (entry.getValue() == null || entry.getValue().length() == 0) {
|
||||
continue;
|
||||
} else if (!isNumeric(entry.getValue())) {
|
||||
log.info("福利值非数字!");
|
||||
throw new SalaryRunTimeException("福利值非数字");
|
||||
}
|
||||
|
||||
//根据福利方案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) {
|
||||
log.info("根据福利方案id、险种id、缴纳对象查询明细为null!福利方案id: {}, 福利明细项id:{}", primaryId, Long.valueOf(entry.getKey()));
|
||||
throw new SalaryRunTimeException("根据福利方案id、险种id、缴纳对象查询明细为null!福利方案id: "+primaryId+", 福利明细项id:{}"+ Long.valueOf(entry.getKey()));
|
||||
}
|
||||
List<InsuranceSchemeDetailPO> isPaymentList = insuranceSchemeDetailPOList.stream()
|
||||
.filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList());
|
||||
if (isPaymentList.size() > 0) {
|
||||
InsuranceSchemeDetailPO insuranceSchemeDetailPO = isPaymentList.get(0);
|
||||
|
||||
encryptUtil.decrypt(insuranceSchemeDetailPO, InsuranceSchemeDetailPO.class);
|
||||
String lowerLimit = "0.000".equals(insuranceSchemeDetailPO.getLowerLimit()) ? null : insuranceSchemeDetailPO.getLowerLimit();
|
||||
String upperLimit = "0.000".equals(insuranceSchemeDetailPO.getUpperLimit()) ? null : insuranceSchemeDetailPO.getUpperLimit();
|
||||
if (lowerLimit != null && lowerLimit.length() > 0 && Double.parseDouble(entry.getValue()) < Double.parseDouble(lowerLimit)) {
|
||||
//数值低于对应福利明细下限
|
||||
entry.setValue(lowerLimit);
|
||||
}
|
||||
if (upperLimit != null && upperLimit.length() > 0 && Double.parseDouble(entry.getValue()) > Double.parseDouble(upperLimit)) {
|
||||
//数值高于对应福利明细上限
|
||||
entry.setValue(upperLimit);
|
||||
}
|
||||
} else {
|
||||
log.info("福利明细项属于未缴费状态,不对上下限进行约束");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return JSON.toJSONString(paymentBaseJson);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue