From 84aeb5059ff3acbe88ee3629bed30b82af9c66ff Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 28 Dec 2022 17:01:15 +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=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=B0=83=E5=B7=AE=E6=96=B9?= =?UTF-8?q?=E5=BC=8F3=E6=97=B6=E7=9A=84=E7=A6=8F=E5=88=A9=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 13 + .../salary/service/SIRepairService.java | 5 + .../service/impl/SIRepairServiceImpl.java | 258 +++++++++++++++++- .../salary/web/SIAccountController.java | 12 + .../salary/wrapper/SIAccountWrapper.java | 9 + 5 files changed, 296 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 13d29c7ad..1b97c0367 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -1014,7 +1014,20 @@ public class SIAccountBiz extends Service { .paymentOrganization(param.getPaymentOrganization()) .projects(param.getProjects()) .billMonth(param.getBillMonth()) + .supplementType(param.getSupplementType()) .build(); + if ("2".equals(param.getSupplementType())) { + supplementAccountBaseParam.setSocialPaymentBaseString(param.getSocialPaymentBaseString()); + supplementAccountBaseParam.setFundPaymentBaseString(param.getFundPaymentBaseString()); + supplementAccountBaseParam.setOtherPaymentBaseString(param.getOtherPaymentBaseString()); + } else if("3".equals(param.getSupplementType())) { + supplementAccountBaseParam.setSocialPaymentPerString(param.getSocialPaymentPerString()); + supplementAccountBaseParam.setSocialPaymentComString(param.getSocialPaymentComString()); + supplementAccountBaseParam.setFundPaymentPerString(param.getFundPaymentPerString()); + supplementAccountBaseParam.setFundPaymentComString(param.getFundPaymentComString()); + supplementAccountBaseParam.setOtherPaymentPerString(param.getOtherPaymentPerString()); + supplementAccountBaseParam.setOtherPaymentComString(param.getOtherPaymentComString()); + } baseList.add(supplementAccountBaseParam); }); }); diff --git a/src/com/engine/salary/service/SIRepairService.java b/src/com/engine/salary/service/SIRepairService.java index 0893665e1..2b4dacc38 100644 --- a/src/com/engine/salary/service/SIRepairService.java +++ b/src/com/engine/salary/service/SIRepairService.java @@ -8,4 +8,9 @@ import java.util.Map; public interface SIRepairService { List> getSupplementPaymentForm(SupplementAccountBaseParam param); + + /** + * 获取待编辑的补缴费用相关福利项 + */ + List> getPaymentGroup(SupplementAccountBaseParam param); } diff --git a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java index 2f82ed8f5..943f955ac 100644 --- a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java @@ -6,12 +6,15 @@ import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.siaccount.param.SaveSupplementaryAccountParam; import com.engine.salary.entity.siaccount.param.SupplementAccountBaseParam; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; -import com.engine.salary.entity.siarchives.po.InsuranceArchivesAccountPO; +import com.engine.salary.entity.siarchives.po.*; import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.enums.siaccount.ProjectTypeEnum; import com.engine.salary.enums.sicategory.DataTypeEnum; 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.service.SIRepairService; import com.engine.salary.util.SalaryEntityUtil; @@ -35,6 +38,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { return MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class); } + private SocialSchemeMapper getSocialSchemeMapper() { + return MapperProxyFactory.getProxy(SocialSchemeMapper.class); + } + + private FundSchemeMapper getFundSchemeMapper() { + return MapperProxyFactory.getProxy(FundSchemeMapper.class); + } + + private OtherSchemeMapper getOtherSchemeMapper() { + return MapperProxyFactory.getProxy(OtherSchemeMapper.class); + } + /** * 获取指定月份的福利缴纳基数作为补缴基数 * @param param @@ -124,5 +139,246 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { } + /** + * 获取待编辑的补缴费用相关福利项 + */ + @Override + public List> getPaymentGroup(SupplementAccountBaseParam param) { + + Long paymentOrganization = param.getPaymentOrganization(); + List projects = param.getProjects(); + 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 = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); + Map categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName); + + List> resultList = new ArrayList<>(); + if (projects.contains(ProjectTypeEnum.ALL.getValue())) { + if (socialSchemePO != null) { + Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); + + socialMap.forEach((k, v) -> { + Map perMap = new HashMap<>(); + Map comMap = new HashMap<>(); + 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 (fundSchemePO != null) { + Map fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap().getClass()); + fundMap.forEach((k, v) -> { + Map perMap = new HashMap<>(); + Map comMap = new HashMap<>(); + 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 (otherSchemePO != null) { + Map otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap().getClass()); + otherMap.forEach((k, v) -> { + Map perMap = new HashMap<>(); + Map comMap = new HashMap<>(); + 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); + }); + } + return resultList; + } + if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { + if (socialSchemePO != null) { + Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); + + socialMap.forEach((k, v) -> { + Map perMap = new HashMap<>(); + Map comMap = new HashMap<>(); + 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 ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) + && (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) + && (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) { + if (socialSchemePO != null) { + 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)); + socialMap.forEach((k, v) -> { + Map perMap = new HashMap<>(); + Map comMap = new HashMap<>(); + 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 ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) + && (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) + && (!projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) { + if (socialSchemePO != null) { + 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)); + + socialMap.forEach((k, v) -> { + Map perMap = new HashMap<>(); + Map comMap = new HashMap<>(); + 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 ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) + && (!projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) + && (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) { + if (socialSchemePO != null) { + 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)); + socialMap.forEach((k, v) -> { + Map perMap = new HashMap<>(); + Map comMap = new HashMap<>(); + 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 (projects.contains(ProjectTypeEnum.FUND.getValue())) { + if (fundSchemePO != null) { + Map fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap().getClass()); + + fundMap.forEach((k, v) -> { + Map perMap = new HashMap<>(); + Map comMap = new HashMap<>(); + 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 (projects.contains(ProjectTypeEnum.OTHER.getValue())) { + if (otherSchemePO != null) { + Map otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap().getClass()); + + otherMap.forEach((k, v) -> { + Map perMap = new HashMap<>(); + Map comMap = new HashMap<>(); + 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); + }); + + } + } + + return resultList; + } + } diff --git a/src/com/engine/salary/web/SIAccountController.java b/src/com/engine/salary/web/SIAccountController.java index f274178a6..2710ac14e 100644 --- a/src/com/engine/salary/web/SIAccountController.java +++ b/src/com/engine/salary/web/SIAccountController.java @@ -890,4 +890,16 @@ public class SIAccountController { User user = HrmUserVarify.getUser(request, response); return new ResponseResult>>(user).run(getSIAccountWrapper(user)::getSupplementPaymentForm, param); } + + /** + * 获取待编辑的补缴费用相关福利项 + */ + @POST + @Path("/detail/getPaymentGroup") + @Produces(MediaType.APPLICATION_JSON) + public String getPaymentGroup(@Context HttpServletRequest request, @Context HttpServletResponse response, + @RequestBody SupplementAccountBaseParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>>(user).run(getSIAccountWrapper(user)::getPaymentGroup, param); + } } diff --git a/src/com/engine/salary/wrapper/SIAccountWrapper.java b/src/com/engine/salary/wrapper/SIAccountWrapper.java index e2e2cc8a7..a65e420a9 100644 --- a/src/com/engine/salary/wrapper/SIAccountWrapper.java +++ b/src/com/engine/salary/wrapper/SIAccountWrapper.java @@ -146,4 +146,13 @@ public class SIAccountWrapper extends Service { public List> getSupplementPaymentForm(SupplementAccountBaseParam param) { return getSIRepairService(user).getSupplementPaymentForm(param); } + + /** + * 获取待编辑的补缴费用相关福利项 + * @param param + * @return + */ + public List> getPaymentGroup(SupplementAccountBaseParam param) { + return getSIRepairService(user).getPaymentGroup(param); + } }