薪酬系统-福利核算,补差待编辑福利项列表功能接口,补缴第三种方式的待编辑福利项获取逻辑优化,补差编辑tab页待编辑福利项获取逻辑优化

This commit is contained in:
sy 2023-11-24 14:05:03 +08:00
parent 9876bc49cf
commit c8e3d6312b
7 changed files with 703 additions and 160 deletions

View File

@ -0,0 +1,64 @@
package com.engine.salary.entity.siaccount.param;
import com.engine.salary.util.valid.DataCheck;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author: sy
* @Description: 组装补差基本数据
* @Date: 2023/11/23
**/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BalanceAccountBaseParam {
//员工id")
private Long employeeId;
//账单月份")
private String billMonth;
/**
* 个税扣缴义务人id
*/
@DataCheck(require = true,message = "个税扣缴义务人不能为空")
private Long paymentOrganization;
/**
* 社保补缴金额_个人
*/
private String socialPerJson;
/**
* 社保补缴金额_单位
*/
private String socialComJson;
/**
* 公积金补缴金额_个人
*/
private String fundPerJson;
/**
* 公积金补缴金额_单位
*/
private String fundComJson;
/**
* 其他福利补缴金额_个人
*/
private String otherPerJson;
/**
* 其他福利补缴金额_单位
*/
private String otherComJson;
}

View File

@ -1,10 +1,20 @@
package com.engine.salary.service; package com.engine.salary.service;
import com.engine.salary.entity.siaccount.param.BalanceAccountBaseParam;
import com.engine.salary.entity.siaccount.param.InspectAccountParam; import com.engine.salary.entity.siaccount.param.InspectAccountParam;
import java.util.List;
import java.util.Map;
public interface SIBalanceService { public interface SIBalanceService {
void del(InspectAccountParam param, Long employeeId); void del(InspectAccountParam param, Long employeeId);
/**
* 获取待编辑的补差费用相关福利项
*/
List<Map<String, String>> getPaymentGroup(BalanceAccountBaseParam param);
void addNewBalance(BalanceAccountBaseParam param);
} }

View File

@ -37,10 +37,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum;
import com.engine.salary.enums.siaccount.*; import com.engine.salary.enums.siaccount.*;
import com.engine.salary.enums.sicategory.DataTypeEnum; import com.engine.salary.enums.sicategory.*;
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.enums.sicategory.IsUseEnum;
import com.engine.salary.enums.sicategory.WelfareTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.InsuranceExportMapper; import com.engine.salary.mapper.InsuranceExportMapper;
import com.engine.salary.mapper.siaccount.ExcelInsuranceDetailMapper; import com.engine.salary.mapper.siaccount.ExcelInsuranceDetailMapper;
@ -208,6 +205,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
return ServiceUtil.getService(SIExportServiceImpl.class, user); return ServiceUtil.getService(SIExportServiceImpl.class, user);
} }
private SIBalanceService getSIBalanceService(User user) {
return (SIBalanceService) ServiceUtil.getService(SIBalanceServiceImpl.class, user);
}
@Override @Override
public Map<String, Object> listPage(InsuranceAccountBatchParam queryParam) { public Map<String, Object> listPage(InsuranceAccountBatchParam queryParam) {
Long employeeId = (long) user.getUID(); Long employeeId = (long) user.getUID();
@ -2789,8 +2790,28 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
List<Map<String, String>> resultList = new ArrayList<>(); List<Map<String, String>> resultList = new ArrayList<>();
resultList.addAll(perList); resultList.addAll(perList);
resultList.addAll(comList); resultList.addAll(comList);
// resultMap.put("data", resultList);
//20231123逻辑变更对于补差的待编辑内容扩充其人员档案设置的福利项内容
if (insuranceAccountDetailPO.getPaymentStatus().equals(PaymentStatusEnum.BALANCE.getValue())) {
List<Map<String, String>> balancePaymentGroup = getSIBalanceService(user).getPaymentGroup(BalanceAccountBaseParam.builder()
.employeeId(insuranceAccountDetailPO.getEmployeeId())
.paymentOrganization(insuranceAccountDetailPO.getPaymentOrganization()).build());
if (balancePaymentGroup != null && balancePaymentGroup.size() > 0) {
//抽取已有福利项生成map
Map<String, Object> targetMap = new HashMap<>();
for (Map<String, String> resultItem : resultList) {
targetMap.put(resultItem.get("insuranceId") + "-" + resultItem.get("paymentScope"), resultItem);
}
//对比可进行缴纳福利项与上面的已有福利项生成map
for (Map<String, String> balancePayItem : balancePaymentGroup) {
if (targetMap.get(balancePayItem.get("insuranceId") + "-" + balancePayItem.get("paymentScope")) == null) {
balancePayItem.put("insuranceValue", "");
resultList.add(balancePayItem);
}
}
}
}
resultMap.put("data", resultList); resultMap.put("data", resultList);
return resultMap; return resultMap;
} }
@ -3183,7 +3204,15 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
if (list.isEmpty()) { if (list.isEmpty()) {
//新增数据情况 //新增数据情况
InsuranceAccountDetailPO createPO = buildBalanceAccountDetail(paymentOrganization, insuranceCategoryPOS, singleAccount, billMonth, employeeId, currentEmployeeId); InsuranceAccountDetailPO createPO = buildBalanceAccountDetail(paymentOrganization, insuranceCategoryPOS, singleAccount, billMonth, employeeId, currentEmployeeId);
if(checkBalance(createPO)) {
if(!checkBalancePayInsurance(createPO)) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "补差数据中存在福利档案中未设置的福利项缴纳数值,请检查补差缴纳信息!"));
excelComments.add(errorMessageMap);
}
if(checkBalance(createPO) && !isError) {
createInsuranceAccountDetailList.add(createPO); createInsuranceAccountDetailList.add(createPO);
} else { } else {
isError = true; isError = true;
@ -3202,7 +3231,15 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
//拼装待更新数据 //拼装待更新数据
encryptUtil.decryptList(list, InsuranceAccountDetailPO.class); encryptUtil.decryptList(list, InsuranceAccountDetailPO.class);
InsuranceAccountDetailPO updatePO = handleInsuranceAccountDetail(list.get(0), map); InsuranceAccountDetailPO updatePO = handleInsuranceAccountDetail(list.get(0), map);
if(checkBalance(updatePO)) {
if(!checkBalancePayInsurance(updatePO)) {
isError = true;
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "补差数据中存在福利档案中未设置的福利项缴纳数值,请检查补差缴纳信息!"));
excelComments.add(errorMessageMap);
}
if(checkBalance(updatePO) && !isError) {
updateInsuranceAccountDetailList.add(updatePO); updateInsuranceAccountDetailList.add(updatePO);
} else { } else {
isError = true; isError = true;
@ -3461,6 +3498,183 @@ public class SIAccountServiceImpl extends Service implements SIAccountService {
} }
} }
/**
* 检查补差数据中的福利缴纳费用相关福利项是否在正常缴纳中方案所设置可缴纳
* @param po
* @return
*/
private boolean checkBalancePayInsurance(InsuranceAccountDetailPO po) {
InsuranceAccountDetailPO commonAccountPO = getInsuranceAccountDetailMapper().getOneByBpep(InsuranceAccountDetailPO.builder()
.billMonth(po.getBillMonth())
.paymentStatus(PaymentStatusEnum.COMMON.getValue())
.employeeId(po.getEmployeeId())
.paymentOrganization(po.getPaymentOrganization())
.build());
if (commonAccountPO != null) {
encryptUtil.decrypt(commonAccountPO, InsuranceAccountDetailPO.class);
//判断社保缴纳福利项是否合规
boolean socialPayFlag = true;
Map<String, String> socialPerPayMap = JSON.parseObject(po.getSocialPerJson(), new HashMap<String, String>().getClass());
Map<String, String> socialComPayMap = JSON.parseObject(po.getSocialComJson(), new HashMap<String, String>().getClass());
//目标员工设置了方案时比较方案中缴纳的福利项和补差中设置有效值的福利项
if (po.getSocialSchemeId() != null) {
List<String> payInsuranceIdAndScopeList = payInsuranceIdAndScopeList(po.getSocialSchemeId());
for (Map.Entry<String, String> entry : socialPerPayMap.entrySet()) {
if (!payInsuranceIdAndScopeList.contains(entry.getKey() + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())
&& StringUtils.isNotBlank(entry.getValue())) {
socialPayFlag = false;
break;
}
}
if (socialPayFlag) {
for (Map.Entry<String, String> entry : socialComPayMap.entrySet()) {
if (!payInsuranceIdAndScopeList.contains(entry.getKey() + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())
&& StringUtils.isNotBlank(entry.getValue())) {
socialPayFlag = false;
break;
}
}
}
} else {
//目标员工未设置方案时判断补差中是否设置有效值的福利项
for (Map.Entry<String, String> entry : socialPerPayMap.entrySet()) {
if (StringUtils.isNotBlank(entry.getValue())) {
socialPayFlag = false;
break;
}
}
if (socialPayFlag) {
for (Map.Entry<String, String> entry : socialComPayMap.entrySet()) {
if (StringUtils.isNotBlank(entry.getValue())) {
socialPayFlag = false;
break;
}
}
}
}
//判断公积金缴纳福利项是否合规
boolean fundPayFlag = true;
Map<String, String> fundPerPayMap = JSON.parseObject(po.getFundPerJson(), new HashMap<String, String>().getClass());
Map<String, String> fundComPayMap = JSON.parseObject(po.getFundComJson(), new HashMap<String, String>().getClass());
//目标员工设置了方案时比较方案中缴纳的福利项和补差中设置有效值的福利项
if (po.getFundSchemeId() != null) {
List<String> payInsuranceIdAndScopeList = payInsuranceIdAndScopeList(po.getFundSchemeId());
for (Map.Entry<String, String> entry : fundPerPayMap.entrySet()) {
if (!payInsuranceIdAndScopeList.contains(entry.getKey() + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())
&& StringUtils.isNotBlank(entry.getValue())) {
fundPayFlag = false;
break;
}
}
if (fundPayFlag) {
for (Map.Entry<String, String> entry : fundComPayMap.entrySet()) {
if (!payInsuranceIdAndScopeList.contains(entry.getKey() + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())
&& StringUtils.isNotBlank(entry.getValue())) {
fundPayFlag = false;
break;
}
}
}
} else {
//目标员工未设置方案时判断补差中是否设置有效值的福利项
for (Map.Entry<String, String> entry : fundPerPayMap.entrySet()) {
if (StringUtils.isNotBlank(entry.getValue())) {
fundPayFlag = false;
break;
}
}
if (fundPayFlag) {
for (Map.Entry<String, String> entry : fundComPayMap.entrySet()) {
if (StringUtils.isNotBlank(entry.getValue())) {
fundPayFlag = false;
break;
}
}
}
}
//判断其他福利缴纳福利项是否合规
boolean otherPayFlag = true;
Map<String, String> otherPerPayMap = JSON.parseObject(po.getOtherPerJson(), new HashMap<String, String>().getClass());
Map<String, String> otherComPayMap = JSON.parseObject(po.getOtherComJson(), new HashMap<String, String>().getClass());
//目标员工设置了方案时比较方案中缴纳的福利项和补差中设置有效值的福利项
if (po.getOtherSchemeId() != null) {
List<String> payInsuranceIdAndScopeList = payInsuranceIdAndScopeList(po.getOtherSchemeId());
for (Map.Entry<String, String> entry : otherPerPayMap.entrySet()) {
if (!payInsuranceIdAndScopeList.contains(entry.getKey() + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())
&& StringUtils.isNotBlank(entry.getValue())) {
otherPayFlag = false;
break;
}
}
if (otherPayFlag) {
for (Map.Entry<String, String> entry : otherComPayMap.entrySet()) {
if (!payInsuranceIdAndScopeList.contains(entry.getKey() + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())
&& StringUtils.isNotBlank(entry.getValue())) {
otherPayFlag = false;
break;
}
}
}
} else {
//目标员工未设置方案时判断补差中是否设置有效值的福利项
for (Map.Entry<String, String> entry : otherPerPayMap.entrySet()) {
if (StringUtils.isNotBlank(entry.getValue())) {
otherPayFlag = false;
break;
}
}
if (otherPayFlag) {
for (Map.Entry<String, String> entry : otherComPayMap.entrySet()) {
if (StringUtils.isNotBlank(entry.getValue())) {
otherPayFlag = false;
break;
}
}
}
}
//在社保公积金其他福利档案中未设置的福利项被补差设置有效数值时不允许更新
if (socialPayFlag && fundPayFlag && otherPayFlag) {
return true;
} else {
return false;
}
} else {
return false;
}
}
public List<String> payInsuranceIdAndScopeList(Long schemeId) {
//查询该福利方案下开启缴纳的福利项
List<InsuranceSchemeDetailPO> detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(schemeId);
List<String> insuranceIdList = new ArrayList<>();
if (detailPOS != null && detailPOS.size() > 0) {
//开启缴纳的
insuranceIdList = detailPOS.stream().filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue())).map(m -> {
return m.getInsuranceId() .toString() + "-" + m.getPaymentScope().toString();
}).collect(Collectors.toList());
}
return insuranceIdList;
}
public InsuranceAccountDetailPO buildBalanceAccountDetail(Long paymentOrganization, List<ICategoryPO> insuranceCategoryPOS, public InsuranceAccountDetailPO buildBalanceAccountDetail(Long paymentOrganization, List<ICategoryPO> insuranceCategoryPOS,
List<Map<String, Object>> singleAccount, String billMonth, Long employeeId, Long creator) { List<Map<String, Object>> singleAccount, String billMonth, Long employeeId, Long creator) {
InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO(); InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO();

View File

@ -1,19 +1,42 @@
package com.engine.salary.service.impl; package com.engine.salary.service.impl;
import com.alibaba.fastjson.JSON;
import com.api.formmode.mybatis.util.SqlProxyHandle; import com.api.formmode.mybatis.util.SqlProxyHandle;
import com.engine.common.util.ServiceUtil; import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.salary.encrypt.EncryptUtil;
import com.engine.salary.entity.siaccount.param.BalanceAccountBaseParam;
import com.engine.salary.entity.siaccount.param.InspectAccountParam; import com.engine.salary.entity.siaccount.param.InspectAccountParam;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesEmployeePO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO;
import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO;
import com.engine.salary.entity.sicategory.po.ICategoryPO;
import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
import com.engine.salary.enums.sicategory.IsPaymentEnum;
import com.engine.salary.enums.sicategory.PaymentScopeEnum;
import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
import com.engine.salary.mapper.siarchives.FundSchemeMapper;
import com.engine.salary.mapper.siarchives.OtherSchemeMapper;
import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
import com.engine.salary.service.SIAccountService; import com.engine.salary.service.SIAccountService;
import com.engine.salary.service.SIBalanceService; import com.engine.salary.service.SIBalanceService;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.db.MapperProxyFactory;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.hrm.User; import weaver.hrm.User;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
@ -31,6 +54,28 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
return ServiceUtil.getService(SIAccountServiceImpl.class, user); return ServiceUtil.getService(SIAccountServiceImpl.class, user);
} }
private SocialSchemeMapper getSocialSchemeMapper() {
return MapperProxyFactory.getProxy(SocialSchemeMapper.class);
}
private FundSchemeMapper getFundSchemeMapper() {
return MapperProxyFactory.getProxy(FundSchemeMapper.class);
}
private OtherSchemeMapper getOtherSchemeMapper() {
return MapperProxyFactory.getProxy(OtherSchemeMapper.class);
}
private ICategoryMapper getICategoryMapper() {
return MapperProxyFactory.getProxy(ICategoryMapper.class);
}
private InsuranceSchemeDetailMapper getInsuranceSchemeDetailMapper() {
return MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class);
}
private EncryptUtil encryptUtil = new EncryptUtil();
@Override @Override
public void del(InspectAccountParam param, Long employeeId) { public void del(InspectAccountParam param, Long employeeId) {
@ -46,4 +91,146 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService {
//刷新bill_batch表中统计信息 //刷新bill_batch表中统计信息
getSIAccountService(user).refreshBillBatch(param.getPaymentOrganization(), param.getBillMonth()); getSIAccountService(user).refreshBillBatch(param.getPaymentOrganization(), param.getBillMonth());
} }
/**
* 获取待编辑的补差费用相关福利项
*/
@Override
public List<Map<String, String>> getPaymentGroup(BalanceAccountBaseParam param) {
Long paymentOrganization = param.getPaymentOrganization();
Long employeeId = param.getEmployeeId();
InsuranceArchivesSocialSchemePO socialSchemePO = new InsuranceArchivesSocialSchemePO();
InsuranceArchivesFundSchemePO fundSchemePO = new InsuranceArchivesFundSchemePO();
InsuranceArchivesOtherSchemePO otherSchemePO = new InsuranceArchivesOtherSchemePO();
List<InsuranceArchivesSocialSchemePO> socialSchemePOList = getSocialSchemeMapper().getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
.employeeId(employeeId)
.paymentOrganization(paymentOrganization)
.build());
if (socialSchemePOList.size() > 0) {
encryptUtil.decryptList(socialSchemePOList, InsuranceArchivesSocialSchemePO.class);
socialSchemePO = socialSchemePOList.get(0);
}
List<InsuranceArchivesFundSchemePO> fundSchemePOList = getFundSchemeMapper().getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
.employeeId(employeeId)
.paymentOrganization(paymentOrganization)
.build());
if (fundSchemePOList.size() > 0) {
encryptUtil.decryptList(fundSchemePOList, InsuranceArchivesFundSchemePO.class);
fundSchemePO = fundSchemePOList.get(0);
}
List<InsuranceArchivesOtherSchemePO> otherSchemePOList = getOtherSchemeMapper().getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder()
.employeeId(employeeId)
.paymentOrganization(paymentOrganization)
.build());
if (otherSchemePOList.size() > 0) {
encryptUtil.decryptList(otherSchemePOList, InsuranceArchivesOtherSchemePO.class);
otherSchemePO = otherSchemePOList.get(0);
}
List<ICategoryPO> allCategoryList = getICategoryMapper().listAll();
Map<Long, String> categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName);
Map<Long, Integer> welfareTypeMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getWelfareType);
List<Map<String, String>> resultList = new ArrayList<>();
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
socialMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
Map<String, String> comMap = new HashMap<>();
comMap.put("title", welfareTypeName + "公司" + "缴纳");
comMap.put("insuranceId", k);
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
Map<String, String> perMap = new HashMap<>();
perMap.put("title", welfareTypeName + "个人" + "缴纳");
perMap.put("insuranceId", k);
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
resultList.add(perMap);
}
});
}
if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) {
Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(fundSchemePO.getFundSchemeId());
fundMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
Map<String, String> comMap = new HashMap<>();
comMap.put("title", welfareTypeName + "公司" + "缴纳");
comMap.put("insuranceId", k);
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
Map<String, String> perMap = new HashMap<>();
perMap.put("title", welfareTypeName + "个人" + "缴纳");
perMap.put("insuranceId", k);
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
resultList.add(perMap);
}
});
}
if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) {
Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(otherSchemePO.getOtherSchemeId());
otherMap.forEach((k, v) -> {
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
Map<String, String> comMap = new HashMap<>();
comMap.put("title", welfareTypeName + "公司" + "缴纳");
comMap.put("insuranceId", k);
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
comMap.put("paymentScope", "公司");
resultList.add(comMap);
}
if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
Map<String, String> perMap = new HashMap<>();
perMap.put("title", welfareTypeName + "个人" + "缴纳");
perMap.put("insuranceId", k);
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
resultList.add(perMap);
}
});
}
return resultList;
}
@Override
public void addNewBalance(BalanceAccountBaseParam param) {
}
public List<String> payInsuranceIdAndScopeList(Long socialSchemeId) {
//查询该福利方案下开启缴纳的福利项
List<InsuranceSchemeDetailPO> detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialSchemeId);
List<String> insuranceIdList = new ArrayList<>();
if (detailPOS != null && detailPOS.size() > 0) {
//开启缴纳的
insuranceIdList = detailPOS.stream().filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue())).map(m -> {
return m.getInsuranceId() .toString() + "-" + m.getPaymentScope().toString();
}).collect(Collectors.toList());
}
return insuranceIdList;
}
} }

View File

@ -8,14 +8,18 @@ import com.engine.salary.entity.siaccount.param.SupplementAccountBaseParam;
import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO;
import com.engine.salary.entity.siarchives.po.*; import com.engine.salary.entity.siarchives.po.*;
import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.entity.sicategory.po.ICategoryPO;
import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO;
import com.engine.salary.enums.siaccount.ProjectTypeEnum; import com.engine.salary.enums.siaccount.ProjectTypeEnum;
import com.engine.salary.enums.sicategory.DataTypeEnum; import com.engine.salary.enums.sicategory.DataTypeEnum;
import com.engine.salary.enums.sicategory.IsPaymentEnum;
import com.engine.salary.enums.sicategory.PaymentScopeEnum;
import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper;
import com.engine.salary.mapper.siarchives.FundSchemeMapper; import com.engine.salary.mapper.siarchives.FundSchemeMapper;
import com.engine.salary.mapper.siarchives.OtherSchemeMapper; import com.engine.salary.mapper.siarchives.OtherSchemeMapper;
import com.engine.salary.mapper.siarchives.SocialSchemeMapper; import com.engine.salary.mapper.siarchives.SocialSchemeMapper;
import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper;
import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper;
import com.engine.salary.service.SIRepairService; import com.engine.salary.service.SIRepairService;
import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.SalaryI18nUtil;
@ -55,6 +59,10 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
return MapperProxyFactory.getProxy(ICategoryMapper.class); return MapperProxyFactory.getProxy(ICategoryMapper.class);
} }
private InsuranceSchemeDetailMapper getInsuranceSchemeDetailMapper() {
return MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class);
}
/** /**
* 获取指定月份的福利缴纳基数作为补缴基数 * 获取指定月份的福利缴纳基数作为补缴基数
* @param param * @param param
@ -214,71 +222,76 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
if (projects.contains(ProjectTypeEnum.ALL.getValue())) { if (projects.contains(ProjectTypeEnum.ALL.getValue())) {
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) { if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass()); Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
socialMap.forEach((k, v) -> { socialMap.forEach((k, v) -> {
Map<String, String> perMap = new HashMap<>();
Map<String, String> comMap = new HashMap<>();
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
perMap.put("title", welfareTypeName); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
comMap.put("title", welfareTypeName); Map<String, String> comMap = new HashMap<>();
comMap.put("title", welfareTypeName);
perMap.put("insuranceId", k); comMap.put("insuranceId", k);
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人"); comMap.put("paymentScope", "公司");
resultList.add(comMap);
comMap.put("insuranceId", k); }
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
comMap.put("paymentScope", "公司"); Map<String, String> perMap = new HashMap<>();
perMap.put("title", welfareTypeName);
resultList.add(perMap); perMap.put("insuranceId", k);
resultList.add(comMap); perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
resultList.add(perMap);
}
}); });
} }
if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) { if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) {
Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass()); Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(fundSchemePO.getFundSchemeId());
fundMap.forEach((k, v) -> { fundMap.forEach((k, v) -> {
Map<String, String> perMap = new HashMap<>();
Map<String, String> comMap = new HashMap<>();
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
perMap.put("title", welfareTypeName); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
comMap.put("title", welfareTypeName); Map<String, String> comMap = new HashMap<>();
comMap.put("title", welfareTypeName);
perMap.put("insuranceId", k); comMap.put("insuranceId", k);
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人"); comMap.put("paymentScope", "公司");
resultList.add(comMap);
comMap.put("insuranceId", k); }
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
comMap.put("paymentScope", "公司"); Map<String, String> perMap = new HashMap<>();
perMap.put("title", welfareTypeName);
resultList.add(perMap); perMap.put("insuranceId", k);
resultList.add(comMap); perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
resultList.add(perMap);
}
}); });
} }
if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) { if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) {
Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass()); Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(otherSchemePO.getOtherSchemeId());
otherMap.forEach((k, v) -> { otherMap.forEach((k, v) -> {
Map<String, String> perMap = new HashMap<>();
Map<String, String> comMap = new HashMap<>();
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
perMap.put("title", welfareTypeName); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
comMap.put("title", welfareTypeName); Map<String, String> comMap = new HashMap<>();
comMap.put("title", welfareTypeName);
perMap.put("insuranceId", k); comMap.put("insuranceId", k);
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人"); comMap.put("paymentScope", "公司");
resultList.add(comMap);
comMap.put("insuranceId", k); }
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
comMap.put("paymentScope", "公司"); Map<String, String> perMap = new HashMap<>();
perMap.put("title", welfareTypeName);
resultList.add(perMap); perMap.put("insuranceId", k);
resultList.add(comMap); perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
resultList.add(perMap);
}
}); });
} }
return resultList; return resultList;
@ -286,25 +299,26 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) {
if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) { if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass()); Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
socialMap.forEach((k, v) -> { socialMap.forEach((k, v) -> {
Map<String, String> perMap = new HashMap<>();
Map<String, String> comMap = new HashMap<>();
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
perMap.put("title", welfareTypeName); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
comMap.put("title", welfareTypeName); Map<String, String> comMap = new HashMap<>();
comMap.put("title", welfareTypeName);
perMap.put("insuranceId", k); comMap.put("insuranceId", k);
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人"); comMap.put("paymentScope", "公司");
resultList.add(comMap);
comMap.put("insuranceId", k); }
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
comMap.put("paymentScope", "公司"); Map<String, String> perMap = new HashMap<>();
perMap.put("title", welfareTypeName);
resultList.add(perMap); perMap.put("insuranceId", k);
resultList.add(comMap); perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
resultList.add(perMap);
}
}); });
} }
@ -316,24 +330,26 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass()); Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()) || "9002".equals(e.getKey())) socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()) || "9002".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
socialMap.forEach((k, v) -> { socialMap.forEach((k, v) -> {
Map<String, String> perMap = new HashMap<>();
Map<String, String> comMap = new HashMap<>();
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
perMap.put("title", welfareTypeName); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
comMap.put("title", welfareTypeName); Map<String, String> comMap = new HashMap<>();
comMap.put("title", welfareTypeName);
perMap.put("insuranceId", k); comMap.put("insuranceId", k);
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人"); comMap.put("paymentScope", "公司");
resultList.add(comMap);
comMap.put("insuranceId", k); }
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
comMap.put("paymentScope", "公司"); Map<String, String> perMap = new HashMap<>();
perMap.put("title", welfareTypeName);
resultList.add(perMap); perMap.put("insuranceId", k);
resultList.add(comMap); perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
resultList.add(perMap);
}
}); });
} }
@ -345,25 +361,26 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass()); Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey())) socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
socialMap.forEach((k, v) -> { socialMap.forEach((k, v) -> {
Map<String, String> perMap = new HashMap<>();
Map<String, String> comMap = new HashMap<>();
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
perMap.put("title", welfareTypeName); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
comMap.put("title", welfareTypeName); Map<String, String> comMap = new HashMap<>();
comMap.put("title", welfareTypeName);
perMap.put("insuranceId", k); comMap.put("insuranceId", k);
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人"); comMap.put("paymentScope", "公司");
resultList.add(comMap);
comMap.put("insuranceId", k); }
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
comMap.put("paymentScope", "公司"); Map<String, String> perMap = new HashMap<>();
perMap.put("title", welfareTypeName);
resultList.add(perMap); perMap.put("insuranceId", k);
resultList.add(comMap); perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
resultList.add(perMap);
}
}); });
} }
@ -375,24 +392,26 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass()); Map<String, String> socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap<String, String>().getClass());
socialMap = socialMap.entrySet().stream().filter(e -> "9002".equals(e.getKey())) socialMap = socialMap.entrySet().stream().filter(e -> "9002".equals(e.getKey()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId());
socialMap.forEach((k, v) -> { socialMap.forEach((k, v) -> {
Map<String, String> perMap = new HashMap<>();
Map<String, String> comMap = new HashMap<>();
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
perMap.put("title", welfareTypeName); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
comMap.put("title", welfareTypeName); Map<String, String> comMap = new HashMap<>();
comMap.put("title", welfareTypeName);
perMap.put("insuranceId", k); comMap.put("insuranceId", k);
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人"); comMap.put("paymentScope", "公司");
resultList.add(comMap);
comMap.put("insuranceId", k); }
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
comMap.put("paymentScope", "公司"); Map<String, String> perMap = new HashMap<>();
perMap.put("title", welfareTypeName);
resultList.add(perMap); perMap.put("insuranceId", k);
resultList.add(comMap); perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
resultList.add(perMap);
}
}); });
} }
@ -400,25 +419,26 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
if (projects.contains(ProjectTypeEnum.FUND.getValue())) { if (projects.contains(ProjectTypeEnum.FUND.getValue())) {
if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) { if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) {
Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass()); Map<String, String> fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(fundSchemePO.getFundSchemeId());
fundMap.forEach((k, v) -> { fundMap.forEach((k, v) -> {
Map<String, String> perMap = new HashMap<>();
Map<String, String> comMap = new HashMap<>();
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
perMap.put("title", welfareTypeName); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
comMap.put("title", welfareTypeName); Map<String, String> comMap = new HashMap<>();
comMap.put("title", welfareTypeName);
perMap.put("insuranceId", k); comMap.put("insuranceId", k);
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人"); comMap.put("paymentScope", "公司");
resultList.add(comMap);
comMap.put("insuranceId", k); }
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
comMap.put("paymentScope", "公司"); Map<String, String> perMap = new HashMap<>();
perMap.put("title", welfareTypeName);
resultList.add(perMap); perMap.put("insuranceId", k);
resultList.add(comMap); perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
resultList.add(perMap);
}
}); });
} }
@ -426,25 +446,26 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { if (projects.contains(ProjectTypeEnum.OTHER.getValue())) {
if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) { if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) {
Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass()); Map<String, String> otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap<String, String>().getClass());
//查询该福利方案下开启缴纳的福利项
List<String> insuranceIdAndScopeList = payInsuranceIdAndScopeList(otherSchemePO.getOtherSchemeId());
otherMap.forEach((k, v) -> { otherMap.forEach((k, v) -> {
Map<String, String> perMap = new HashMap<>();
Map<String, String> comMap = new HashMap<>();
String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" );
perMap.put("title", welfareTypeName); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) {
comMap.put("title", welfareTypeName); Map<String, String> comMap = new HashMap<>();
comMap.put("title", welfareTypeName);
perMap.put("insuranceId", k); comMap.put("insuranceId", k);
perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人"); comMap.put("paymentScope", "公司");
resultList.add(comMap);
comMap.put("insuranceId", k); }
comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue())) {
comMap.put("paymentScope", "公司"); Map<String, String> perMap = new HashMap<>();
perMap.put("title", welfareTypeName);
resultList.add(perMap); perMap.put("insuranceId", k);
resultList.add(comMap); perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k)));
perMap.put("paymentScope", "个人");
resultList.add(perMap);
}
}); });
} }
@ -453,5 +474,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService {
return resultList; return resultList;
} }
public List<String> payInsuranceIdAndScopeList(Long socialSchemeId) {
//查询该福利方案下开启缴纳的福利项
List<InsuranceSchemeDetailPO> detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialSchemeId);
List<String> insuranceIdList = new ArrayList<>();
if (detailPOS != null && detailPOS.size() > 0) {
//开启缴纳的
insuranceIdList = detailPOS.stream().filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue())).map(m -> {
return m.getInsuranceId() .toString() + "-" + m.getPaymentScope().toString();
}).collect(Collectors.toList());
}
return insuranceIdList;
}
} }

View File

@ -1103,4 +1103,28 @@ public class SIAccountController {
User user = HrmUserVarify.getUser(request, response); User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SupplementAccountBaseParam, List<Map<String, String>>>(user).run(getSIAccountWrapper(user)::getPaymentGroup, param); return new ResponseResult<SupplementAccountBaseParam, List<Map<String, String>>>(user).run(getSIAccountWrapper(user)::getPaymentGroup, param);
} }
/**
* 获取待编辑的补差费用相关福利项
*/
@POST
@Path("/detail/getBalancePaymentGroup")
@Produces(MediaType.APPLICATION_JSON)
public String getBalancePaymentGroup(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody BalanceAccountBaseParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<BalanceAccountBaseParam, List<Map<String, String>>>(user).run(getSIAccountWrapper(user)::getBalancePaymentGroup, param);
}
/**
* 新增补差数据
*/
@POST
@Path("/detail/addNewBalance")
@Produces(MediaType.APPLICATION_JSON)
public String addNewBalance(@Context HttpServletRequest request, @Context HttpServletResponse response,
@RequestBody BalanceAccountBaseParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<BalanceAccountBaseParam, String>(user).run(getSIAccountWrapper(user)::addNewBalance, param);
}
} }

View File

@ -6,10 +6,7 @@ import com.engine.core.impl.Service;
import com.engine.salary.entity.hrm.dto.HrmInfoDTO; import com.engine.salary.entity.hrm.dto.HrmInfoDTO;
import com.engine.salary.entity.hrm.param.HrmQueryParam; import com.engine.salary.entity.hrm.param.HrmQueryParam;
import com.engine.salary.entity.siaccount.dto.InsuranceCompensationDTO; import com.engine.salary.entity.siaccount.dto.InsuranceCompensationDTO;
import com.engine.salary.entity.siaccount.param.CompensationParam; import com.engine.salary.entity.siaccount.param.*;
import com.engine.salary.entity.siaccount.param.InspectAccountParam;
import com.engine.salary.entity.siaccount.param.RecessionParam;
import com.engine.salary.entity.siaccount.param.SupplementAccountBaseParam;
import com.engine.salary.service.SIBalanceService; import com.engine.salary.service.SIBalanceService;
import com.engine.salary.service.SICompensationService; import com.engine.salary.service.SICompensationService;
import com.engine.salary.service.SIRecessionService; import com.engine.salary.service.SIRecessionService;
@ -155,4 +152,17 @@ public class SIAccountWrapper extends Service {
public List<Map<String, String>> getPaymentGroup(SupplementAccountBaseParam param) { public List<Map<String, String>> getPaymentGroup(SupplementAccountBaseParam param) {
return getSIRepairService(user).getPaymentGroup(param); return getSIRepairService(user).getPaymentGroup(param);
} }
/**
* 获取待编辑的补差费用相关福利项
* @param param
* @return
*/
public List<Map<String, String>> getBalancePaymentGroup(BalanceAccountBaseParam param) {
return getSIBalanceService(user).getPaymentGroup(param);
}
public void addNewBalance(BalanceAccountBaseParam param) {
getSIBalanceService(user).addNewBalance(param);
}
} }