薪酬系统-福利档案,档案明细获取逻辑改造,根据应用设置中的区分开关,判定后将公司的福利基数信息单独区分返回

This commit is contained in:
sy 2023-12-06 09:51:07 +08:00
parent 3687bdfcdc
commit 451c9fb07b
10 changed files with 119 additions and 10 deletions

View File

@ -14,7 +14,6 @@ import com.cloudstore.eccom.pc.table.WeaTableColumn;
import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.encrypt.AESEncryptUtil;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.siarchives.bo.InsuranceArchivesBO;
@ -37,6 +36,10 @@ import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper;
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.impl.SalaryEmployeeServiceImpl;
import com.engine.salary.sys.entity.po.SalarySysConfPO;
import com.engine.salary.sys.enums.OpenEnum;
import com.engine.salary.sys.service.SalarySysConfService;
import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl;
import com.engine.salary.util.SalaryAssert;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryFormItemUtil;
@ -65,6 +68,8 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_DIFF_BY_PER_AND_COM;
/**
* @Author weaver_cl
@ -113,6 +118,10 @@ public class SIArchivesBiz {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
private SalarySysConfService getSalarySysConfService(User user) {
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
}
/**
* @param welfareType
* @param employeeId
@ -266,15 +275,18 @@ public class SIArchivesBiz {
*/
public Map<String, Object> getPaymentForm(User user, WelfareTypeEnum welfareType, Long employeeId, long operateId, Long schemeId, Long paymentOrganization) {
Map<String, Object> data = new HashMap<>(16);
//判断是否要区分个人和单位福利基数
SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM);
boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue());
switch (welfareType) {
case SOCIAL_SECURITY:
data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization);
data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign);
break;
case ACCUMULATION_FUND:
data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization);
data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign);
break;
case OTHER:
data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization);
data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign);
break;
default:
}
@ -289,12 +301,16 @@ public class SIArchivesBiz {
* @param operateId
* @return
*/
public Map<String, Object> buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) {
public Map<String, Object> buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) {
Map<String, Object> dataMap = new HashMap<>();
InsuranceArchivesOtherSchemeDTO data = buildOtherForm(employeeId, operateId, paymentOrganization);
if (data != null) {
dataMap.put("data", JSONObject.parseObject(data.getOtherPaymentBaseString(), new TypeReference<Map<String, Object>>() {
}));
if (welBaseDiffSign) {
dataMap.put("comData", JSONObject.parseObject(data.getOtherPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
}));
}
}
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> inputItems = buildPaymentBase(user, schemeId, welfareType);
@ -311,13 +327,17 @@ public class SIArchivesBiz {
* @param operateId
* @return
*/
public Map<String, Object> buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) {
public Map<String, Object> buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) {
Map<String, Object> dataMap = new HashMap<>();
InsuranceArchivesFundSchemeDTO data = buildFundForm(employeeId, operateId, paymentOrganization);
if (data != null) {
dataMap.put("data", JSONObject.parseObject(data.getFundPaymentBaseString(), new TypeReference<Map<String, Object>>() {
}));
if (welBaseDiffSign) {
dataMap.put("comData", JSONObject.parseObject(data.getFundPaymentComBaseString(), new TypeReference<Map<String, Object>>() {
}));
}
}
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> inputItems = buildPaymentBase(user, schemeId, welfareType);
@ -334,18 +354,28 @@ public class SIArchivesBiz {
* @param operateId
* @return
*/
public Map<String, Object> buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) {
public Map<String, Object> buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) {
Map<String, Object> dataMap = new HashMap<>();
InsuranceArchivesSocialSchemeDTO data = buildSocialForm(employeeId, operateId, paymentOrganization);
if (data != null) {
dataMap.put("data", JSONObject.parseObject(data.getSchemePaymentBaseString(), new TypeReference<Map<String, Object>>() {
}));
if (welBaseDiffSign) {
dataMap.put("comData", JSONObject.parseObject(data.getSchemePaymentComBaseString(), new TypeReference<Map<String, Object>>() {
}));
}
}
List<SearchConditionGroup> addGroups = new ArrayList<>();
List<SearchConditionItem> inputItems = buildPaymentBase(user, schemeId, welfareType);
addGroups.add(new SearchConditionGroup("社保缴纳基数", true, inputItems));
dataMap.put("items", addGroups);
if (welBaseDiffSign) {
List<SearchConditionGroup> addComGroups = new ArrayList<>();
List<SearchConditionItem> inputComItems = buildPaymentComBase(user, schemeId, welfareType);
addComGroups.add(new SearchConditionGroup("社保缴纳基数", true, inputComItems));
dataMap.put("comItems", addComGroups);
}
return dataMap;
}
@ -361,9 +391,27 @@ public class SIArchivesBiz {
if (schemeId == null) {
return new ArrayList<>();
}
List<InsuranceSchemeDetailPO> list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream().collect(Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceSchemeDetailPO::getInsuranceId))), ArrayList::new)
);
List<InsuranceSchemeDetailPO> list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream()
.filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue())).collect(Collectors.toList());
SICategoryBiz siCategoryBiz = new SICategoryBiz();
list.forEach(insuranceSchemeDetail -> {
ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId());
if (iCategoryPO != null) {
// inputItems.add(SalaryFormItemUtil.inputNumberItem(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId())));
inputItems.add(SalaryFormItemUtil.inputNumberItemWithMaxAndMin(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId())
, insuranceSchemeDetail.getUpperLimit(), insuranceSchemeDetail.getLowerLimit()));
}
});
return inputItems;
}
public List<SearchConditionItem> buildPaymentComBase(User user, Long schemeId, Integer welfareType) {
List<SearchConditionItem> inputItems = new ArrayList<>();
if (schemeId == null) {
return new ArrayList<>();
}
List<InsuranceSchemeDetailPO> list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream()
.filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue())).collect(Collectors.toList());
SICategoryBiz siCategoryBiz = new SICategoryBiz();
list.forEach(insuranceSchemeDetail -> {
ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId());

View File

@ -106,6 +106,12 @@ public class InsuranceAccountDetailPO {
@Encrypt
private String socialPaymentBaseString;
/**
* 社保缴纳基数单位
*/
@Encrypt
private String socialPaymentComBaseString;
/**
* 公积金方案ID
*/
@ -117,6 +123,12 @@ public class InsuranceAccountDetailPO {
@Encrypt
private String fundPaymentBaseString;
/**
* 公积金缴纳基数单位
*/
@Encrypt
private String fundPaymentComBaseString;
/**
* 其他福利方案id
*/
@ -128,6 +140,12 @@ public class InsuranceAccountDetailPO {
@Encrypt
private String otherPaymentBaseString;
/**
* 其他福利缴纳基数单位
*/
@Encrypt
private String otherPaymentComBaseString;
/**
* 社保个人缴费明细
*/

View File

@ -65,4 +65,6 @@ public class InsuranceArchivesFundSchemeDTO {
//缴纳基数
private String fundPaymentBaseString;
private String fundPaymentComBaseString;
}

View File

@ -56,5 +56,7 @@ public class InsuranceArchivesOtherSchemeDTO {
private String otherPaymentBaseString;
private String otherPaymentComBaseString;
//private WeaForm otherPaymentBase;
}

View File

@ -59,4 +59,7 @@ public class InsuranceArchivesSocialSchemeDTO {
//社保缴纳基数
private String schemePaymentBaseString;
//社保缴纳基数单位
private String schemePaymentComBaseString;
}

View File

@ -87,6 +87,13 @@ public class InsuranceArchivesFundSchemePO {
@Encrypt
private String fundPaymentBaseString;
/**
* 公积金缴纳基数单位
*/
@Encrypt
private String fundPaymentComBaseString;
/**
* 租户key
*/

View File

@ -77,6 +77,12 @@ public class InsuranceArchivesOtherSchemePO {
@Encrypt
private String otherPaymentBaseString;
/**
* 其他福利缴纳基数单位
*/
@Encrypt
private String otherPaymentComBaseString;
/**
* 租户key
*/

View File

@ -83,6 +83,12 @@ public class InsuranceArchivesSocialSchemePO {
@Encrypt
private String socialPaymentBaseString;
/**
* 社保缴纳基数单位
*/
@Encrypt
private String socialPaymentComBaseString;
/**
* 租户key
*/

View File

@ -105,4 +105,9 @@ public class SalarySysConstant {
* 核算固定列头数
*/
public static final String SALARY_ACCT_FIXED_COLUMNS = "salaryAcctFixedColumns";
/**
* 应用设置是否福利档案基数区分个人和单位
*/
public static final String WEL_BASE_DIFF_BY_PER_AND_COM = "welBaseDiffByPerAndCom";
}

View File

@ -755,8 +755,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
insuranceArchivesSocialSchemePos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo));
po.setSocialPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentComBaseString(), sysConfPo));
} else {
po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString()));
po.setSocialPaymentComBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentComBaseString()));
}
});
List<List<InsuranceArchivesSocialSchemePO>> partition = Lists.partition(insuranceArchivesSocialSchemePos, 50);
@ -782,8 +784,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
insuranceArchivesFundSchemePos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo));
po.setFundPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentComBaseString(), sysConfPo));
} else {
po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString()));
po.setFundPaymentComBaseString(AESEncryptUtil.encrypt(po.getFundPaymentComBaseString()));
}
});
List<List<InsuranceArchivesFundSchemePO>> partition = Lists.partition(insuranceArchivesFundSchemePos, 50);
@ -809,8 +813,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
insuranceArchivesOtherSchemePos.forEach(po -> {
if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) {
po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo));
po.setOtherPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentComBaseString(), sysConfPo));
} else {
po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString()));
po.setOtherPaymentComBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentComBaseString()));
}
});
List<List<InsuranceArchivesOtherSchemePO>> partition = Lists.partition(insuranceArchivesOtherSchemePos, 50);
@ -869,6 +875,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo));
po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo));
po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo));
po.setSocialPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentComBaseString(), sysConfPo));
po.setFundPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentComBaseString(), sysConfPo));
po.setOtherPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentComBaseString(), sysConfPo));
po.setSocialPerJson(AESEncryptUtil.closeEncryptSetting(po.getSocialPerJson(), sysConfPo));
po.setSocialPerSum(AESEncryptUtil.closeEncryptSetting(po.getSocialPerSum(), sysConfPo));
po.setFundPerJson(AESEncryptUtil.closeEncryptSetting(po.getFundPerJson(), sysConfPo));
@ -887,6 +896,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe
po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString()));
po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString()));
po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString()));
po.setSocialPaymentComBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentComBaseString()));
po.setFundPaymentComBaseString(AESEncryptUtil.encrypt(po.getFundPaymentComBaseString()));
po.setOtherPaymentComBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentComBaseString()));
po.setSocialPerJson(AESEncryptUtil.encrypt(po.getSocialPerJson()));
po.setSocialPerSum(AESEncryptUtil.encrypt(po.getSocialPerSum()));
po.setFundPerJson(AESEncryptUtil.encrypt(po.getFundPerJson()));