From c8e3d6312bc331e8f40cc1b36690e31300c1a874 Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 24 Nov 2023 14:05:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=A0=B8=E7=AE=97=EF=BC=8C=E8=A1=A5=E5=B7=AE=E5=BE=85?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=A6=8F=E5=88=A9=E9=A1=B9=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=A1=A5=E7=BC=B4?= =?UTF-8?q?=E7=AC=AC=E4=B8=89=E7=A7=8D=E6=96=B9=E5=BC=8F=E7=9A=84=E5=BE=85?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=A6=8F=E5=88=A9=E9=A1=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96=EF=BC=8C=E8=A1=A5=E5=B7=AE?= =?UTF-8?q?=E7=BC=96=E8=BE=91tab=E9=A1=B5=E5=BE=85=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E9=A1=B9=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/BalanceAccountBaseParam.java | 64 ++++ .../salary/service/SIBalanceService.java | 10 + .../service/impl/SIAccountServiceImpl.java | 228 +++++++++++- .../service/impl/SIBalanceServiceImpl.java | 187 ++++++++++ .../service/impl/SIRepairServiceImpl.java | 332 ++++++++++-------- .../salary/web/SIAccountController.java | 24 ++ .../salary/wrapper/SIAccountWrapper.java | 18 +- 7 files changed, 703 insertions(+), 160 deletions(-) create mode 100644 src/com/engine/salary/entity/siaccount/param/BalanceAccountBaseParam.java diff --git a/src/com/engine/salary/entity/siaccount/param/BalanceAccountBaseParam.java b/src/com/engine/salary/entity/siaccount/param/BalanceAccountBaseParam.java new file mode 100644 index 000000000..fb0e402ba --- /dev/null +++ b/src/com/engine/salary/entity/siaccount/param/BalanceAccountBaseParam.java @@ -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; + +} diff --git a/src/com/engine/salary/service/SIBalanceService.java b/src/com/engine/salary/service/SIBalanceService.java index a1fe81d17..66dba0f98 100644 --- a/src/com/engine/salary/service/SIBalanceService.java +++ b/src/com/engine/salary/service/SIBalanceService.java @@ -1,10 +1,20 @@ package com.engine.salary.service; +import com.engine.salary.entity.siaccount.param.BalanceAccountBaseParam; import com.engine.salary.entity.siaccount.param.InspectAccountParam; +import java.util.List; +import java.util.Map; + public interface SIBalanceService { void del(InspectAccountParam param, Long employeeId); + /** + * 获取待编辑的补差费用相关福利项 + */ + List> getPaymentGroup(BalanceAccountBaseParam param); + + void addNewBalance(BalanceAccountBaseParam param); } diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index e1b3cae36..b0ebb5944 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -37,10 +37,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.enums.siaccount.*; -import com.engine.salary.enums.sicategory.DataTypeEnum; -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.enums.sicategory.*; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.InsuranceExportMapper; import com.engine.salary.mapper.siaccount.ExcelInsuranceDetailMapper; @@ -208,6 +205,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { return ServiceUtil.getService(SIExportServiceImpl.class, user); } + private SIBalanceService getSIBalanceService(User user) { + return (SIBalanceService) ServiceUtil.getService(SIBalanceServiceImpl.class, user); + } + @Override public Map listPage(InsuranceAccountBatchParam queryParam) { Long employeeId = (long) user.getUID(); @@ -2789,8 +2790,28 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { List> resultList = new ArrayList<>(); resultList.addAll(perList); resultList.addAll(comList); +// resultMap.put("data", resultList); + //20231123逻辑变更,对于补差的待编辑内容,扩充其人员档案设置的福利项内容 + if (insuranceAccountDetailPO.getPaymentStatus().equals(PaymentStatusEnum.BALANCE.getValue())) { + List> balancePaymentGroup = getSIBalanceService(user).getPaymentGroup(BalanceAccountBaseParam.builder() + .employeeId(insuranceAccountDetailPO.getEmployeeId()) + .paymentOrganization(insuranceAccountDetailPO.getPaymentOrganization()).build()); + if (balancePaymentGroup != null && balancePaymentGroup.size() > 0) { + //抽取已有福利项生成map + Map targetMap = new HashMap<>(); + for (Map resultItem : resultList) { + targetMap.put(resultItem.get("insuranceId") + "-" + resultItem.get("paymentScope"), resultItem); + } + //对比可进行缴纳福利项与上面的已有福利项生成map + for (Map balancePayItem : balancePaymentGroup) { + if (targetMap.get(balancePayItem.get("insuranceId") + "-" + balancePayItem.get("paymentScope")) == null) { + balancePayItem.put("insuranceValue", ""); + resultList.add(balancePayItem); + } + } + } + } resultMap.put("data", resultList); - return resultMap; } @@ -3183,7 +3204,15 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (list.isEmpty()) { //新增数据情况 InsuranceAccountDetailPO createPO = buildBalanceAccountDetail(paymentOrganization, insuranceCategoryPOS, singleAccount, billMonth, employeeId, currentEmployeeId); - if(checkBalance(createPO)) { + + if(!checkBalancePayInsurance(createPO)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "补差数据中存在福利档案中未设置的福利项缴纳数值,请检查补差缴纳信息!")); + excelComments.add(errorMessageMap); + } + + if(checkBalance(createPO) && !isError) { createInsuranceAccountDetailList.add(createPO); } else { isError = true; @@ -3202,7 +3231,15 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //拼装待更新数据 encryptUtil.decryptList(list, InsuranceAccountDetailPO.class); InsuranceAccountDetailPO updatePO = handleInsuranceAccountDetail(list.get(0), map); - if(checkBalance(updatePO)) { + + if(!checkBalancePayInsurance(updatePO)) { + isError = true; + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", row + SalaryI18nUtil.getI18nLabel(0, "补差数据中存在福利档案中未设置的福利项缴纳数值,请检查补差缴纳信息!")); + excelComments.add(errorMessageMap); + } + + if(checkBalance(updatePO) && !isError) { updateInsuranceAccountDetailList.add(updatePO); } else { 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 socialPerPayMap = JSON.parseObject(po.getSocialPerJson(), new HashMap().getClass()); + Map socialComPayMap = JSON.parseObject(po.getSocialComJson(), new HashMap().getClass()); + //目标员工设置了方案时,比较方案中缴纳的福利项和补差中设置(有效值)的福利项 + if (po.getSocialSchemeId() != null) { + List payInsuranceIdAndScopeList = payInsuranceIdAndScopeList(po.getSocialSchemeId()); + for (Map.Entry entry : socialPerPayMap.entrySet()) { + if (!payInsuranceIdAndScopeList.contains(entry.getKey() + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue()) + && StringUtils.isNotBlank(entry.getValue())) { + socialPayFlag = false; + break; + } + + } + if (socialPayFlag) { + for (Map.Entry entry : socialComPayMap.entrySet()) { + if (!payInsuranceIdAndScopeList.contains(entry.getKey() + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue()) + && StringUtils.isNotBlank(entry.getValue())) { + socialPayFlag = false; + break; + } + + } + } + + } else { + //目标员工未设置方案时,判断补差中是否设置(有效值)的福利项 + for (Map.Entry entry : socialPerPayMap.entrySet()) { + if (StringUtils.isNotBlank(entry.getValue())) { + socialPayFlag = false; + break; + } + + } + if (socialPayFlag) { + for (Map.Entry entry : socialComPayMap.entrySet()) { + if (StringUtils.isNotBlank(entry.getValue())) { + socialPayFlag = false; + break; + } + + } + } + } + + //判断公积金缴纳福利项是否合规 + boolean fundPayFlag = true; + Map fundPerPayMap = JSON.parseObject(po.getFundPerJson(), new HashMap().getClass()); + Map fundComPayMap = JSON.parseObject(po.getFundComJson(), new HashMap().getClass()); + //目标员工设置了方案时,比较方案中缴纳的福利项和补差中设置(有效值)的福利项 + if (po.getFundSchemeId() != null) { + List payInsuranceIdAndScopeList = payInsuranceIdAndScopeList(po.getFundSchemeId()); + for (Map.Entry entry : fundPerPayMap.entrySet()) { + if (!payInsuranceIdAndScopeList.contains(entry.getKey() + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue()) + && StringUtils.isNotBlank(entry.getValue())) { + fundPayFlag = false; + break; + } + + } + if (fundPayFlag) { + for (Map.Entry entry : fundComPayMap.entrySet()) { + if (!payInsuranceIdAndScopeList.contains(entry.getKey() + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue()) + && StringUtils.isNotBlank(entry.getValue())) { + fundPayFlag = false; + break; + } + + } + } + + } else { + //目标员工未设置方案时,判断补差中是否设置(有效值)的福利项 + for (Map.Entry entry : fundPerPayMap.entrySet()) { + if (StringUtils.isNotBlank(entry.getValue())) { + fundPayFlag = false; + break; + } + + } + if (fundPayFlag) { + for (Map.Entry entry : fundComPayMap.entrySet()) { + if (StringUtils.isNotBlank(entry.getValue())) { + fundPayFlag = false; + break; + } + + } + } + } + + //判断其他福利缴纳福利项是否合规 + boolean otherPayFlag = true; + Map otherPerPayMap = JSON.parseObject(po.getOtherPerJson(), new HashMap().getClass()); + Map otherComPayMap = JSON.parseObject(po.getOtherComJson(), new HashMap().getClass()); + //目标员工设置了方案时,比较方案中缴纳的福利项和补差中设置(有效值)的福利项 + if (po.getOtherSchemeId() != null) { + List payInsuranceIdAndScopeList = payInsuranceIdAndScopeList(po.getOtherSchemeId()); + for (Map.Entry entry : otherPerPayMap.entrySet()) { + if (!payInsuranceIdAndScopeList.contains(entry.getKey() + "-" + PaymentScopeEnum.SCOPE_PERSON.getValue()) + && StringUtils.isNotBlank(entry.getValue())) { + otherPayFlag = false; + break; + } + + } + if (otherPayFlag) { + for (Map.Entry entry : otherComPayMap.entrySet()) { + if (!payInsuranceIdAndScopeList.contains(entry.getKey() + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue()) + && StringUtils.isNotBlank(entry.getValue())) { + otherPayFlag = false; + break; + } + + } + } + + } else { + //目标员工未设置方案时,判断补差中是否设置(有效值)的福利项 + for (Map.Entry entry : otherPerPayMap.entrySet()) { + if (StringUtils.isNotBlank(entry.getValue())) { + otherPayFlag = false; + break; + } + + } + if (otherPayFlag) { + for (Map.Entry 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 payInsuranceIdAndScopeList(Long schemeId) { + //查询该福利方案下开启缴纳的福利项 + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(schemeId); + List 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 insuranceCategoryPOS, List> singleAccount, String billMonth, Long employeeId, Long creator) { InsuranceAccountDetailPO insuranceAccountDetailPO = new InsuranceAccountDetailPO(); diff --git a/src/com/engine/salary/service/impl/SIBalanceServiceImpl.java b/src/com/engine/salary/service/impl/SIBalanceServiceImpl.java index a3eb975c7..cc2fe32bf 100644 --- a/src/com/engine/salary/service/impl/SIBalanceServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIBalanceServiceImpl.java @@ -1,19 +1,42 @@ package com.engine.salary.service.impl; +import com.alibaba.fastjson.JSON; import com.api.formmode.mybatis.util.SqlProxyHandle; import com.engine.common.util.ServiceUtil; 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.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.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.SIBalanceService; +import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import weaver.hrm.User; +import java.util.ArrayList; +import java.util.HashMap; 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); } + 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 public void del(InspectAccountParam param, Long employeeId) { @@ -46,4 +91,146 @@ public class SIBalanceServiceImpl extends Service implements SIBalanceService { //刷新bill_batch表中统计信息 getSIAccountService(user).refreshBillBatch(param.getPaymentOrganization(), param.getBillMonth()); } + + /** + * 获取待编辑的补差费用相关福利项 + */ + @Override + public List> getPaymentGroup(BalanceAccountBaseParam param) { + + Long paymentOrganization = param.getPaymentOrganization(); + Long employeeId = param.getEmployeeId(); + InsuranceArchivesSocialSchemePO socialSchemePO = new InsuranceArchivesSocialSchemePO(); + InsuranceArchivesFundSchemePO fundSchemePO = new InsuranceArchivesFundSchemePO(); + InsuranceArchivesOtherSchemePO otherSchemePO = new InsuranceArchivesOtherSchemePO(); + + List socialSchemePOList = getSocialSchemeMapper().getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(employeeId) + .paymentOrganization(paymentOrganization) + .build()); + if (socialSchemePOList.size() > 0) { + encryptUtil.decryptList(socialSchemePOList, InsuranceArchivesSocialSchemePO.class); + socialSchemePO = socialSchemePOList.get(0); + } + + List fundSchemePOList = getFundSchemeMapper().getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(employeeId) + .paymentOrganization(paymentOrganization) + .build()); + if (fundSchemePOList.size() > 0) { + encryptUtil.decryptList(fundSchemePOList, InsuranceArchivesFundSchemePO.class); + fundSchemePO = fundSchemePOList.get(0); + } + + List otherSchemePOList = getOtherSchemeMapper().getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(employeeId) + .paymentOrganization(paymentOrganization) + .build()); + if (otherSchemePOList.size() > 0) { + encryptUtil.decryptList(otherSchemePOList, InsuranceArchivesOtherSchemePO.class); + otherSchemePO = otherSchemePOList.get(0); + } + + List allCategoryList = getICategoryMapper().listAll(); + Map categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName); + Map welfareTypeMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getWelfareType); + + List> resultList = new ArrayList<>(); + + if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) { + Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); + //查询该福利方案下开启缴纳的福利项 + List 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 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 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 fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap().getClass()); + //查询该福利方案下开启缴纳的福利项 + List 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 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 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 otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap().getClass()); + //查询该福利方案下开启缴纳的福利项 + List 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 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 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 payInsuranceIdAndScopeList(Long socialSchemeId) { + //查询该福利方案下开启缴纳的福利项 + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialSchemeId); + List 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; + } + } diff --git a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java index 401461d57..a2ac565c4 100644 --- a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java @@ -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.siarchives.po.*; 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.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.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.SIRepairService; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; @@ -55,6 +59,10 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { return MapperProxyFactory.getProxy(ICategoryMapper.class); } + private InsuranceSchemeDetailMapper getInsuranceSchemeDetailMapper() { + return MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class); + } + /** * 获取指定月份的福利缴纳基数作为补缴基数 * @param param @@ -214,71 +222,76 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { if (projects.contains(ProjectTypeEnum.ALL.getValue())) { if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) { Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); - + //查询该福利方案下开启缴纳的福利项 + List insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId()); socialMap.forEach((k, v) -> { - Map perMap = new HashMap<>(); - Map comMap = new HashMap<>(); - String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); - perMap.put("title", welfareTypeName); - comMap.put("title", welfareTypeName); - - perMap.put("insuranceId", k); - perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - perMap.put("paymentScope", "个人"); - - comMap.put("insuranceId", k); - comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - comMap.put("paymentScope", "公司"); - - resultList.add(perMap); - resultList.add(comMap); + if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + Map 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 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 fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap().getClass()); + //查询该福利方案下开启缴纳的福利项 + List insuranceIdAndScopeList = payInsuranceIdAndScopeList(fundSchemePO.getFundSchemeId()); fundMap.forEach((k, v) -> { - Map perMap = new HashMap<>(); - Map comMap = new HashMap<>(); - String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); - perMap.put("title", welfareTypeName); - comMap.put("title", welfareTypeName); - - perMap.put("insuranceId", k); - perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - perMap.put("paymentScope", "个人"); - - comMap.put("insuranceId", k); - comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - comMap.put("paymentScope", "公司"); - - resultList.add(perMap); - resultList.add(comMap); + if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + Map 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 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 otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap().getClass()); + //查询该福利方案下开启缴纳的福利项 + List insuranceIdAndScopeList = payInsuranceIdAndScopeList(otherSchemePO.getOtherSchemeId()); otherMap.forEach((k, v) -> { - Map perMap = new HashMap<>(); - Map comMap = new HashMap<>(); - String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); - perMap.put("title", welfareTypeName); - comMap.put("title", welfareTypeName); - - perMap.put("insuranceId", k); - perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - perMap.put("paymentScope", "个人"); - - comMap.put("insuranceId", k); - comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - comMap.put("paymentScope", "公司"); - - resultList.add(perMap); - resultList.add(comMap); + if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + Map 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 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; @@ -286,25 +299,26 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) { Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); - + //查询该福利方案下开启缴纳的福利项 + List insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId()); socialMap.forEach((k, v) -> { - Map perMap = new HashMap<>(); - Map comMap = new HashMap<>(); - String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); - perMap.put("title", welfareTypeName); - comMap.put("title", welfareTypeName); - - perMap.put("insuranceId", k); - perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - perMap.put("paymentScope", "个人"); - - comMap.put("insuranceId", k); - comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - comMap.put("paymentScope", "公司"); - - resultList.add(perMap); - resultList.add(comMap); + if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + Map 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 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); + } }); } @@ -316,24 +330,26 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey()) || "9002".equals(e.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + //查询该福利方案下开启缴纳的福利项 + List insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId()); socialMap.forEach((k, v) -> { - Map perMap = new HashMap<>(); - Map comMap = new HashMap<>(); - String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); - perMap.put("title", welfareTypeName); - comMap.put("title", welfareTypeName); - - perMap.put("insuranceId", k); - perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - perMap.put("paymentScope", "个人"); - - comMap.put("insuranceId", k); - comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - comMap.put("paymentScope", "公司"); - - resultList.add(perMap); - resultList.add(comMap); + if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + Map 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 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); + } }); } @@ -345,25 +361,26 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); socialMap = socialMap.entrySet().stream().filter(e -> "9001".equals(e.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - + //查询该福利方案下开启缴纳的福利项 + List insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId()); socialMap.forEach((k, v) -> { - Map perMap = new HashMap<>(); - Map comMap = new HashMap<>(); - String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); - perMap.put("title", welfareTypeName); - comMap.put("title", welfareTypeName); - - perMap.put("insuranceId", k); - perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - perMap.put("paymentScope", "个人"); - - comMap.put("insuranceId", k); - comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - comMap.put("paymentScope", "公司"); - - resultList.add(perMap); - resultList.add(comMap); + if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + Map 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 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); + } }); } @@ -375,24 +392,26 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); socialMap = socialMap.entrySet().stream().filter(e -> "9002".equals(e.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + //查询该福利方案下开启缴纳的福利项 + List insuranceIdAndScopeList = payInsuranceIdAndScopeList(socialSchemePO.getSocialSchemeId()); socialMap.forEach((k, v) -> { - Map perMap = new HashMap<>(); - Map comMap = new HashMap<>(); - String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); - perMap.put("title", welfareTypeName); - comMap.put("title", welfareTypeName); - - perMap.put("insuranceId", k); - perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - perMap.put("paymentScope", "个人"); - - comMap.put("insuranceId", k); - comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - comMap.put("paymentScope", "公司"); - - resultList.add(perMap); - resultList.add(comMap); + if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + Map 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 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); + } }); } @@ -400,25 +419,26 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { if (projects.contains(ProjectTypeEnum.FUND.getValue())) { if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) { Map fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap().getClass()); - + //查询该福利方案下开启缴纳的福利项 + List insuranceIdAndScopeList = payInsuranceIdAndScopeList(fundSchemePO.getFundSchemeId()); fundMap.forEach((k, v) -> { - Map perMap = new HashMap<>(); - Map comMap = new HashMap<>(); - String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); - perMap.put("title", welfareTypeName); - comMap.put("title", welfareTypeName); - - perMap.put("insuranceId", k); - perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - perMap.put("paymentScope", "个人"); - - comMap.put("insuranceId", k); - comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - comMap.put("paymentScope", "公司"); - - resultList.add(perMap); - resultList.add(comMap); + if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + Map 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 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); + } }); } @@ -426,25 +446,26 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) { Map otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap().getClass()); - + //查询该福利方案下开启缴纳的福利项 + List insuranceIdAndScopeList = payInsuranceIdAndScopeList(otherSchemePO.getOtherSchemeId()); otherMap.forEach((k, v) -> { - Map perMap = new HashMap<>(); - Map comMap = new HashMap<>(); - String welfareTypeName = welfareTypeMap.get(Long.valueOf(k)) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(k)) == 2 ? "公积金" : "企业年金及其它福利" ); - perMap.put("title", welfareTypeName); - comMap.put("title", welfareTypeName); - - perMap.put("insuranceId", k); - perMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - perMap.put("paymentScope", "个人"); - - comMap.put("insuranceId", k); - comMap.put("insuranceName", categoryNameMap.get(Long.valueOf(k))); - comMap.put("paymentScope", "公司"); - - resultList.add(perMap); - resultList.add(comMap); + if (insuranceIdAndScopeList.contains(k + "-" + PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + Map 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 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); + } }); } @@ -453,5 +474,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { return resultList; } + public List payInsuranceIdAndScopeList(Long socialSchemeId) { + //查询该福利方案下开启缴纳的福利项 + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialSchemeId); + List 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; + } + } diff --git a/src/com/engine/salary/web/SIAccountController.java b/src/com/engine/salary/web/SIAccountController.java index 6a27fafdf..75ad6975a 100644 --- a/src/com/engine/salary/web/SIAccountController.java +++ b/src/com/engine/salary/web/SIAccountController.java @@ -1103,4 +1103,28 @@ public class SIAccountController { User user = HrmUserVarify.getUser(request, response); return new ResponseResult>>(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>>(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(user).run(getSIAccountWrapper(user)::addNewBalance, param); + } } diff --git a/src/com/engine/salary/wrapper/SIAccountWrapper.java b/src/com/engine/salary/wrapper/SIAccountWrapper.java index a65e420a9..9b9e754b6 100644 --- a/src/com/engine/salary/wrapper/SIAccountWrapper.java +++ b/src/com/engine/salary/wrapper/SIAccountWrapper.java @@ -6,10 +6,7 @@ import com.engine.core.impl.Service; import com.engine.salary.entity.hrm.dto.HrmInfoDTO; import com.engine.salary.entity.hrm.param.HrmQueryParam; import com.engine.salary.entity.siaccount.dto.InsuranceCompensationDTO; -import com.engine.salary.entity.siaccount.param.CompensationParam; -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.entity.siaccount.param.*; import com.engine.salary.service.SIBalanceService; import com.engine.salary.service.SICompensationService; import com.engine.salary.service.SIRecessionService; @@ -155,4 +152,17 @@ public class SIAccountWrapper extends Service { public List> getPaymentGroup(SupplementAccountBaseParam param) { return getSIRepairService(user).getPaymentGroup(param); } + + /** + * 获取待编辑的补差费用相关福利项 + * @param param + * @return + */ + public List> getBalancePaymentGroup(BalanceAccountBaseParam param) { + return getSIBalanceService(user).getPaymentGroup(param); + } + + public void addNewBalance(BalanceAccountBaseParam param) { + getSIBalanceService(user).addNewBalance(param); + } }