From af15ffcc238312a71b9ba79f65edcbefa1365f5f Mon Sep 17 00:00:00 2001 From: sy Date: Tue, 27 Dec 2022 14:01:08 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=A1=A5=E7=BC=B4?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD=E6=94=B9=E9=80=A0v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 218 +++++++++++++++++- .../param/SaveSupplementaryAccountParam.java | 50 ++++ .../param/SupplementAccountBaseParam.java | 50 ++++ 3 files changed, 311 insertions(+), 7 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index e5c864004..13d29c7ad 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -166,6 +166,9 @@ public class SIAccountBiz extends Service { .updateTime(new Date()) .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) .paymentOrganization(param.getPaymentOrganization()) + .socialPay("0") + .fundPay("0") + .otherPay("0") .build(); encryptUtil.encrypt(build, InsuranceAccountBatchPO.class); getInsuranceAccountBatchMapper().insert(build); @@ -1067,13 +1070,43 @@ public class SIAccountBiz extends Service { //缴纳组织=个税扣缴义务人 insuranceAccountDetailPO.setSocialPayOrg(baseParam.getPaymentOrganization()); if (projects.contains(ProjectTypeEnum.ALL.getValue())) { - accountSocial(insuranceAccountDetailPO, accountPO); - accountFund(insuranceAccountDetailPO, accountPO); - accountOther(insuranceAccountDetailPO, accountPO); + if ("2".equals(baseParam.getSupplementType())) { + if (accountPO.getSocial() != null) { + accountPO.getSocial().setSocialPaymentBaseString(baseParam.getSocialPaymentBaseString()); + } + if (accountPO.getFund() != null) { + accountPO.getFund().setFundPaymentBaseString(baseParam.getFundPaymentBaseString()); + } + if (accountPO.getOther() != null) { + accountPO.getOther().setOtherPaymentBaseString(baseParam.getOtherPaymentBaseString()); + } + accountSocial(insuranceAccountDetailPO, accountPO); + accountFund(insuranceAccountDetailPO, accountPO); + accountOther(insuranceAccountDetailPO, accountPO); + } else if ("3".equals(baseParam.getSupplementType())) { + accountSocialByData(insuranceAccountDetailPO, baseParam); + accountFundByData(insuranceAccountDetailPO, baseParam); + accountOtherByData(insuranceAccountDetailPO, baseParam); + } else { + accountSocial(insuranceAccountDetailPO, accountPO); + accountFund(insuranceAccountDetailPO, accountPO); + accountOther(insuranceAccountDetailPO, accountPO); + } + return account(insuranceAccountDetailPO); } if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { - accountSocial(insuranceAccountDetailPO, accountPO); + if ("2".equals(baseParam.getSupplementType())) { + if (accountPO.getSocial() != null) { + accountPO.getSocial().setSocialPaymentBaseString(baseParam.getSocialPaymentBaseString()); + } + accountSocial(insuranceAccountDetailPO, accountPO); + } else if ("3".equals(baseParam.getSupplementType())) { +// accountSocialByData(insuranceAccountDetailPO, baseParam); + } else { + accountSocial(insuranceAccountDetailPO, accountPO); + } + } if (!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { List ids = new ArrayList<>(); @@ -1089,13 +1122,44 @@ public class SIAccountBiz extends Service { .get(); ids.add(insuranceCategoryPO.getId()); } - accountEndowmentInsurance(insuranceAccountDetailPO, accountPO, ids); + if ("2".equals(baseParam.getSupplementType())) { + if (accountPO.getSocial() != null) { + accountPO.getSocial().setSocialPaymentBaseString(baseParam.getSocialPaymentBaseString()); + } + accountEndowmentInsurance(insuranceAccountDetailPO, accountPO, ids); + } else if ("3".equals(baseParam.getSupplementType())) { + accountEndowmentInsuranceByData(insuranceAccountDetailPO, baseParam, ids); + } else { + accountEndowmentInsurance(insuranceAccountDetailPO, accountPO, ids); + } + } if (projects.contains(ProjectTypeEnum.FUND.getValue())) { - accountFund(insuranceAccountDetailPO, accountPO); + if ("2".equals(baseParam.getSupplementType())) { + if (accountPO.getFund() != null) { + accountPO.getFund().setFundPaymentBaseString(baseParam.getFundPaymentBaseString()); + } + accountFund(insuranceAccountDetailPO, accountPO); + } else if ("3".equals(baseParam.getSupplementType())) { + accountFundByData(insuranceAccountDetailPO, baseParam); + } else { + accountFund(insuranceAccountDetailPO, accountPO); + } + } if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { - accountOther(insuranceAccountDetailPO, accountPO); + + if ("2".equals(baseParam.getSupplementType())) { + if (accountPO.getOther() != null) { + accountPO.getOther().setOtherPaymentBaseString(baseParam.getOtherPaymentBaseString()); + } + accountOther(insuranceAccountDetailPO, accountPO); + } else if ("3".equals(baseParam.getSupplementType())) { + accountOtherByData(insuranceAccountDetailPO, baseParam); + } else { + accountOther(insuranceAccountDetailPO, accountPO); + } + } return account(insuranceAccountDetailPO); @@ -1835,4 +1899,144 @@ public class SIAccountBiz extends Service { getInsuranceAccountDetailMapper().updateByEmployeeIdAndBillMonth(insuranceAccountDetailPO); } + public void accountFundByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam) { + //公积金个人 + if (StringUtils.isNotBlank(baseParam.getFundPaymentPerString())) { + List fundPer = new ArrayList<>(); + HashMap fundPerson = JSON.parseObject(baseParam.getFundPaymentPerString(), new HashMap().getClass()); + fundPerson.forEach((k, v) -> { + BigDecimal result = new BigDecimal(v); + fundPer.add(result); + }); + insuranceAccountDetailPO.setFundPerJson(baseParam.getFundPaymentPerString()); + BigDecimal fundPerSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : fundPer) { + fundPerSum = fundPerSum.add(bigDecimal); + } + insuranceAccountDetailPO.setFundPerSum(fundPerSum.toPlainString()); + } + //公积金单位 + if (StringUtils.isNotBlank(baseParam.getFundPaymentComString())) { + List fundCom = new ArrayList<>(); + HashMap fundComMap = JSON.parseObject(baseParam.getFundPaymentComString(), new HashMap().getClass()); + fundComMap.forEach((k, v) -> { + BigDecimal result = new BigDecimal(v); + fundCom.add(result); + }); + insuranceAccountDetailPO.setFundComJson(baseParam.getFundPaymentComString()); + BigDecimal fundComSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : fundCom) { + fundComSum = fundComSum.add(bigDecimal); + } + insuranceAccountDetailPO.setFundComSum(fundComSum.toPlainString()); + } + } + + public void accountOtherByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam) { + //其他福利个人 + if (StringUtils.isNotBlank(baseParam.getOtherPaymentPerString())) { + List otherPer = new ArrayList<>(); + HashMap otherPerMap = JSON.parseObject(baseParam.getOtherPaymentPerString(), new HashMap().getClass()); + otherPerMap.forEach((k, v) -> { + BigDecimal result = new BigDecimal(v); + otherPer.add(result); + }); + insuranceAccountDetailPO.setOtherPerJson(baseParam.getOtherPaymentPerString()); + BigDecimal otherPerSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : otherPer) { + otherPerSum = otherPerSum.add(bigDecimal); + } + insuranceAccountDetailPO.setOtherPerSum(otherPerSum.toPlainString()); + } + //其他福利单位 + if (StringUtils.isNotBlank(baseParam.getOtherPaymentComString())) { + List otherCom = new ArrayList<>(); + HashMap otherComMap = JSON.parseObject(baseParam.getOtherPaymentComString(), new HashMap().getClass()); + otherComMap.forEach((k, v) -> { + BigDecimal result = new BigDecimal(v); + otherCom.add(result); + }); + insuranceAccountDetailPO.setOtherComJson(baseParam.getOtherPaymentComString()); + BigDecimal otherComSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : otherCom) { + otherComSum = otherComSum.add(bigDecimal); + } + insuranceAccountDetailPO.setOtherComSum(otherComSum.toPlainString()); + } + } + + public void accountSocialByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam) { + //社保个人 + if (StringUtils.isNotBlank(baseParam.getSocialPaymentPerString())) { + List socialPer = new ArrayList<>(); + HashMap archivesPerson = JSON.parseObject(baseParam.getSocialPaymentPerString(), new HashMap().getClass()); + archivesPerson.forEach((k, v) -> { + BigDecimal result = new BigDecimal(v); + socialPer.add(result); + }); + insuranceAccountDetailPO.setSocialPerJson(baseParam.getSocialPaymentPerString()); + BigDecimal socialPerSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : socialPer) { + socialPerSum = socialPerSum.add(bigDecimal); + } + insuranceAccountDetailPO.setSocialPerSum(socialPerSum.toPlainString()); + } + //社保单位 + if (StringUtils.isNotBlank(baseParam.getSocialPaymentComString())) { + List socialCom = new ArrayList<>(); + HashMap archivesCom = JSON.parseObject(baseParam.getSocialPaymentComString(), new HashMap().getClass()); + archivesCom.forEach((k, v) -> { + BigDecimal result = new BigDecimal(v); + socialCom.add(result); + }); + insuranceAccountDetailPO.setSocialComJson(baseParam.getSocialPaymentComString()); + BigDecimal socialComSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : socialCom) { + socialComSum = socialComSum.add(bigDecimal); + } + insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString()); + } + } + + public void accountEndowmentInsuranceByData(InsuranceAccountDetailPO insuranceAccountDetailPO, SupplementAccountBaseParam baseParam, List ids) { + //社保个人 + if (StringUtils.isNotBlank(baseParam.getSocialPaymentPerString())) { + List socialPer = new ArrayList<>(); + HashMap archivesPerson = JSON.parseObject(baseParam.getSocialPaymentPerString(), new HashMap().getClass()); + HashMap socialPerson = new HashMap<>(); + archivesPerson.forEach((k, v) -> { + if (ids.contains(Long.valueOf(k))) { + socialPerson.put(k, v); + BigDecimal result = new BigDecimal(v); + socialPer.add(result); + } + + }); + insuranceAccountDetailPO.setSocialPerJson(JSON.toJSONString(socialPerson)); + BigDecimal socialPerSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : socialPer) { + socialPerSum = socialPerSum.add(bigDecimal); + } + insuranceAccountDetailPO.setSocialPerSum(socialPerSum.toPlainString()); + } + //社保单位 + if (StringUtils.isNotBlank(baseParam.getSocialPaymentComString())) { + List socialCom = new ArrayList<>(); + HashMap archivesCom = JSON.parseObject(baseParam.getSocialPaymentComString(), new HashMap().getClass()); + HashMap socialComMap = new HashMap<>(); + archivesCom.forEach((k, v) -> { + if (ids.contains(Long.valueOf(k))) { + socialComMap.put(k, v); + BigDecimal result = new BigDecimal(v); + socialCom.add(result); + } + }); + insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(socialComMap)); + BigDecimal socialComSum = new BigDecimal("0"); + for (BigDecimal bigDecimal : socialCom) { + socialComSum = socialComSum.add(bigDecimal); + } + insuranceAccountDetailPO.setSocialComSum(socialComSum.toPlainString()); + } + } } diff --git a/src/com/engine/salary/entity/siaccount/param/SaveSupplementaryAccountParam.java b/src/com/engine/salary/entity/siaccount/param/SaveSupplementaryAccountParam.java index 86bda6ad7..097cf94fe 100644 --- a/src/com/engine/salary/entity/siaccount/param/SaveSupplementaryAccountParam.java +++ b/src/com/engine/salary/entity/siaccount/param/SaveSupplementaryAccountParam.java @@ -45,4 +45,54 @@ public class SaveSupplementaryAccountParam { */ @DataCheck(require = true,message = "个税扣缴义务人不能为空") private Long paymentOrganization; + + /** + * 社保补缴基数 + */ + private String socialPaymentBaseString; + + /** + * 公积金补缴基数 + */ + private String fundPaymentBaseString; + + /** + * 其他福利补缴基数 + */ + private String otherPaymentBaseString; + + /** + * 社保补缴金额_个人 + */ + private String socialPaymentPerString; + + /** + * 社保补缴金额_单位 + */ + private String socialPaymentComString; + + /** + * 公积金补缴金额_个人 + */ + private String fundPaymentPerString; + + /** + * 公积金补缴金额_单位 + */ + private String fundPaymentComString; + + /** + * 其他福利补缴金额_个人 + */ + private String otherPaymentPerString; + + /** + * 其他福利补缴金额_单位 + */ + private String otherPaymentComString; + + /** + * 补缴类型 + */ + private String supplementType; } diff --git a/src/com/engine/salary/entity/siaccount/param/SupplementAccountBaseParam.java b/src/com/engine/salary/entity/siaccount/param/SupplementAccountBaseParam.java index eb7198f4d..0125705dd 100644 --- a/src/com/engine/salary/entity/siaccount/param/SupplementAccountBaseParam.java +++ b/src/com/engine/salary/entity/siaccount/param/SupplementAccountBaseParam.java @@ -37,4 +37,54 @@ public class SupplementAccountBaseParam { //补缴项目") private List projects; + + /** + * 社保补缴基数 + */ + private String socialPaymentBaseString; + + /** + * 公积金补缴基数 + */ + private String fundPaymentBaseString; + + /** + * 其他福利补缴基数 + */ + private String otherPaymentBaseString; + + /** + * 社保补缴金额_个人 + */ + private String socialPaymentPerString; + + /** + * 社保补缴金额_单位 + */ + private String socialPaymentComString; + + /** + * 公积金补缴金额_个人 + */ + private String fundPaymentPerString; + + /** + * 公积金补缴金额_单位 + */ + private String fundPaymentComString; + + /** + * 其他福利补缴金额_个人 + */ + private String otherPaymentPerString; + + /** + * 其他福利补缴金额_单位 + */ + private String otherPaymentComString; + + /** + * 补缴类型 + */ + private String supplementType; } From 494462092d078c40d82ecc775499f419a37f8e19 Mon Sep 17 00:00:00 2001 From: sy Date: Tue, 27 Dec 2022 17:34:46 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=A1=A5=E7=BC=B4?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E9=80=89=E6=8B=A9=E6=8C=87=E5=AE=9A=E6=9C=88?= =?UTF-8?q?=E7=9A=84=E7=BC=B4=E7=BA=B3=E5=9F=BA=E6=95=B0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InsuranceAccountDetailMapper.xml | 3 +- .../salary/service/SIRepairService.java | 11 ++ .../service/impl/SIRepairServiceImpl.java | 128 ++++++++++++++++++ .../salary/web/SIAccountController.java | 12 ++ .../salary/wrapper/SIAccountWrapper.java | 16 +++ 5 files changed, 169 insertions(+), 1 deletion(-) create mode 100644 src/com/engine/salary/service/SIRepairService.java create mode 100644 src/com/engine/salary/service/impl/SIRepairServiceImpl.java diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index 745571160..6ec6e1bb1 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -305,7 +305,8 @@ t.fund_per_json,t.fund_com_json,t.other_per_json, t.other_com_json,t.social_per_sum,t.social_com_sum, t.fund_per_sum,t.fund_com_sum,t.other_per_sum, - t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization + t.other_com_sum,t.per_sum,t.com_sum,t.payment_organization, + t.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string FROM hrsa_bill_detail t WHERE t.delete_type = 0 diff --git a/src/com/engine/salary/service/SIRepairService.java b/src/com/engine/salary/service/SIRepairService.java new file mode 100644 index 000000000..0893665e1 --- /dev/null +++ b/src/com/engine/salary/service/SIRepairService.java @@ -0,0 +1,11 @@ +package com.engine.salary.service; + +import com.engine.salary.entity.siaccount.param.SupplementAccountBaseParam; + +import java.util.List; +import java.util.Map; + +public interface SIRepairService { + + List> getSupplementPaymentForm(SupplementAccountBaseParam param); +} diff --git a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java new file mode 100644 index 000000000..2f82ed8f5 --- /dev/null +++ b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java @@ -0,0 +1,128 @@ +package com.engine.salary.service.impl; + +import com.alibaba.fastjson.JSON; +import com.engine.core.impl.Service; +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.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.sicategory.ICategoryMapper; +import com.engine.salary.service.SIRepairService; +import com.engine.salary.util.SalaryEntityUtil; +import com.engine.salary.util.SalaryI18nUtil; +import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Maps; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author: sy + * @Description: 福利台账-补缴实现类 + * @Date: 2022/12/27 + **/ +public class SIRepairServiceImpl extends Service implements SIRepairService { + + private EncryptUtil encryptUtil = new EncryptUtil(); + + private InsuranceAccountDetailMapper getInsuranceAccountDetailMapper() { + return MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class); + } + + /** + * 获取指定月份的福利缴纳基数作为补缴基数 + * @param param + * @return + */ + @Override + public List> getSupplementPaymentForm(SupplementAccountBaseParam param) { + + Long paymentOrganization = param.getPaymentOrganization(); + String billMonth = param.getBillMonth(); + List projects = param.getProjects(); + Long employeeId = param.getEmployeeId(); + + List detailPOList = getInsuranceAccountDetailMapper().queryNormalList(billMonth, paymentOrganization, employeeId); + + if (detailPOList.size() > 1) { + throw new SalaryRunTimeException("该人员本次核算出现多组数据,请删除数据库中多余核算项"); + } else if (detailPOList.size() == 0) { + throw new SalaryRunTimeException("数据不存在"); + } else { + InsuranceAccountDetailPO targetDetailPO = detailPOList.get(0); + encryptUtil.decrypt(targetDetailPO, InsuranceAccountDetailPO.class); + + String socialBaseString = targetDetailPO.getSocialPaymentBaseString(); + String fundBaseString = targetDetailPO.getFundPaymentBaseString(); + String otherBaseString = targetDetailPO.getOtherPaymentBaseString(); + + Map socialBaseMap = JSON.parseObject(socialBaseString, HashMap.class); + Map fundBaseMap = JSON.parseObject(fundBaseString, HashMap.class); + Map otherBaseMap = JSON.parseObject(otherBaseString, HashMap.class); + + Map targetBaseMap = new HashMap<>(); + + List allCategoryList = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); + Map categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName); + + if (projects.contains(ProjectTypeEnum.ALL.getValue())) { + targetBaseMap.putAll(socialBaseMap); + targetBaseMap.putAll(fundBaseMap); + targetBaseMap.putAll(otherBaseMap); + } + if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { + targetBaseMap.putAll(socialBaseMap); + } + if (!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { + + List list = MapperProxyFactory.getProxy(ICategoryMapper.class).listByDataType(DataTypeEnum.SYSTEM.getValue()); + + if (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) { + ICategoryPO insuranceCategoryPO = list.stream().filter(item -> SalaryI18nUtil.getI18nLabel(93113, "养老保险").equals(item.getInsuranceName())).findFirst() + .get(); + targetBaseMap.put(insuranceCategoryPO.getId().toString(), socialBaseMap.get(insuranceCategoryPO.getId())); + } + if (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue())) { + ICategoryPO insuranceCategoryPO = list.stream().filter(item -> SalaryI18nUtil.getI18nLabel(93114, "医疗保险").equals(item.getInsuranceName())).findFirst() + .get(); + targetBaseMap.put(insuranceCategoryPO.getId().toString(), socialBaseMap.get(insuranceCategoryPO.getId())); + } + + + } + if (projects.contains(ProjectTypeEnum.FUND.getValue())) { + targetBaseMap.putAll(fundBaseMap); + + } + if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { + + targetBaseMap.putAll(otherBaseMap); + } + + List> resulit = new ArrayList(); + if (targetBaseMap.size() > 0) { + for (Map.Entry entry : targetBaseMap.entrySet()) { + + Map map = new HashMap<>(); + map.put("insuranceId", entry.getKey()); + map.put("insuranceName", categoryNameMap.get(Long.valueOf(entry.getKey()))); + map.put("insuranceBase", entry.getValue()); + + resulit.add(map); + } + } + return resulit; + + } + + + } + + +} diff --git a/src/com/engine/salary/web/SIAccountController.java b/src/com/engine/salary/web/SIAccountController.java index c7e37490c..f274178a6 100644 --- a/src/com/engine/salary/web/SIAccountController.java +++ b/src/com/engine/salary/web/SIAccountController.java @@ -878,4 +878,16 @@ public class SIAccountController { return new ResponseResult>(user).run(getService(user)::listBalancePage, insuranceAccountDetailParam); } // **********************************补差 end*********************************/ + + /** + * 取指定月份的福利缴纳基数作为补缴基数 + */ + @POST + @Path("/detail/getSupplementPaymentForm") + @Produces(MediaType.APPLICATION_JSON) + public String getSupplementPaymentForm(@Context HttpServletRequest request, @Context HttpServletResponse response, + @RequestBody SupplementAccountBaseParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>>(user).run(getSIAccountWrapper(user)::getSupplementPaymentForm, param); + } } diff --git a/src/com/engine/salary/wrapper/SIAccountWrapper.java b/src/com/engine/salary/wrapper/SIAccountWrapper.java index 092398079..e2e2cc8a7 100644 --- a/src/com/engine/salary/wrapper/SIAccountWrapper.java +++ b/src/com/engine/salary/wrapper/SIAccountWrapper.java @@ -9,12 +9,15 @@ 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.service.SIBalanceService; import com.engine.salary.service.SICompensationService; import com.engine.salary.service.SIRecessionService; +import com.engine.salary.service.SIRepairService; import com.engine.salary.service.impl.SIBalanceServiceImpl; import com.engine.salary.service.impl.SICompensationServiceImpl; import com.engine.salary.service.impl.SIRecessionServiceImpl; +import com.engine.salary.service.impl.SIRepairServiceImpl; import com.engine.salary.util.page.PageInfo; import weaver.hrm.User; @@ -41,6 +44,10 @@ public class SIAccountWrapper extends Service { return (SIBalanceService) ServiceUtil.getService(SIBalanceServiceImpl.class, user); } + private SIRepairService getSIRepairService(User user) { + return (SIRepairService) ServiceUtil.getService(SIRepairServiceImpl.class, user); + } + /** * 新增退差数据 * @param param 退差请求体 @@ -130,4 +137,13 @@ public class SIAccountWrapper extends Service { long currentEmployeeId = user.getUID(); getSIBalanceService(user).del(param, currentEmployeeId); } + + /** + * 取指定月份的福利缴纳基数作为补缴基数 + * @param param + * @return + */ + public List> getSupplementPaymentForm(SupplementAccountBaseParam param) { + return getSIRepairService(user).getSupplementPaymentForm(param); + } } From 2f4d580793b5d0ebc85775c755c446749e151ff1 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 28 Dec 2022 11:58:38 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=B0=83=E5=B7=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E4=BC=98=E5=8C=96=EF=BC=8C=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=B8=A6=E5=87=BA=E5=8D=95=E4=BD=8D=E7=BC=B4?= =?UTF-8?q?=E8=B4=B9=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SICompensationServiceImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java index d3a3c4a36..05260e61e 100644 --- a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java +++ b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java @@ -550,6 +550,18 @@ public class SICompensationServiceImpl extends Service implements SICompensation } dto.setCategoryTypeOptions(categoryTypeOptions); + //设置公司核算金额(单位) + CompensationParam compensationParam = CompensationParam.builder() + .categoryType(dto.getCategoryType()) + .employeeId(dto.getEmployeeId().toString()) + .paymentOrganization(dto.getPaymentOrganization()) + .target(Long.valueOf(dto.getTargetOptions().get("id"))) + .build(); + List paramList = new ArrayList<>(); + paramList.add(compensationParam); + List> comTotalList = compensationComTotal(paramList); + dto.setCompanyTotal(comTotalList.get(0).get("totalNum")); + compensationDTOList.add(dto); } } From 84aeb5059ff3acbe88ee3629bed30b82af9c66ff Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 28 Dec 2022 17:01:15 +0800 Subject: [PATCH 04/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=B0=83=E5=B7=AE?= =?UTF-8?q?=E6=96=B9=E5=BC=8F3=E6=97=B6=E7=9A=84=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=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); + } } From 7fba73d3f4c0b028a57a85fe33841ccaeb6749b0 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 29 Dec 2022 09:24:07 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A0=B8=E7=AE=97=E6=97=A0=E6=A0=B8=E7=AE=97=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E7=9B=B4=E6=8E=A5=E8=BF=9B=E5=BA=A6=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 1b97c0367..3739c9d6c 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -309,8 +309,8 @@ public class SIAccountBiz extends Service { ids = param.getIds(); } if (CollectionUtils.isEmpty(ids)) { - //salaryAcctProgressService.fail(tenantKey + param.getBillMonth(), SalaryI18nUtil.getI18nLabel( 100468, "无需要核算的人员")); - getSalaryAcctProgressService(user).fail(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), SalaryI18nUtil.getI18nLabel( 100468, "无需要核算的人员")); + getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), true); +// getSalaryAcctProgressService(user).fail(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), SalaryI18nUtil.getI18nLabel( 100468, "无需要核算的人员")); return; } // SalaryAcctProgressDTO salaryAcctProgressDTO = new SalaryAcctProgressDTO(SalaryI18nUtil.getI18nLabel(97515, "核算中"), 97515L, ids.size(), 0, From ee72dcd3f0876bc422d304f955c65eb409806508 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 29 Dec 2022 14:43:54 +0800 Subject: [PATCH 06/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=B0=83=E5=B7=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA=E9=BB=98=E8=AE=A4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=97=B6=EF=BC=8C=E5=A4=84=E7=90=86=E6=A0=B8=E7=AE=97?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=A4=96=E7=9A=84=E9=BB=98=E8=AE=A4=E4=BA=BA?= =?UTF-8?q?=E5=91=98=E6=95=B0=E6=8D=AE=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SICompensationServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java index 05260e61e..fe45797f6 100644 --- a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java +++ b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java @@ -534,7 +534,12 @@ public class SICompensationServiceImpl extends Service implements SICompensation //设置targetOptions Map targetOptions = new HashMap<>(); targetOptions.put("name", usernameMap.get(configPO.getEmployeeId())); - targetOptions.put("id", detailPOMap.get(configPO.getEmployeeId()).getId().toString()); + String target = detailPOMap.get(configPO.getEmployeeId()).getId().toString(); + if (target == null) { + continue; + } else { + targetOptions.put("id", detailPOMap.get(configPO.getEmployeeId()).getId().toString()); + } dto.setTargetOptions(targetOptions); From e6e16371192b8b14eef7b2dabef1941c085c5d9b Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 29 Dec 2022 17:35:58 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=B0=83=E5=B7=AE?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=A2=9E=E5=8A=A0=E6=97=B6=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=B7=B2=E6=9C=89=E8=B0=83=E5=B7=AE=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SICompensationServiceImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java index fe45797f6..df6bf7d56 100644 --- a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java +++ b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java @@ -293,6 +293,17 @@ public class SICompensationServiceImpl extends Service implements SICompensation continue; } + //判断是否已有调差数据(个税扣缴义务人+账单月份+人员id) + InsuranceCompensationPO nowCompensation = getInsuranceCompensationMapper().getOneByBillMonthPayOrgEmpId(InsuranceCompensationPO.builder() + .billMonth(insuranceAccountDetailPO.getBillMonth()) + .paymentOrganization(insuranceAccountDetailPO.getPaymentOrganization()) + .employeeId(insuranceAccountDetailPO.getEmployeeId()) + .build()); + if (nowCompensation != null) { + errorList.add(usernameMap.get(param.getEmployeeId()) + "-调差失败:调差对象在当前月该缴纳组织下已存在调差数据!"); + continue; + } + encryptUtil.decrypt(insuranceAccountDetailPO, InsuranceAccountDetailPO.class); if (StringUtils.isNotBlank(insuranceAccountDetailPO.getSocialComJson())) { Map socialJson = JSON.parseObject(insuranceAccountDetailPO.getSocialComJson(), new HashMap().getClass()); From 19cca7a1562d2534eaeb73dd9c27b640f2c666b5 Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 30 Dec 2022 18:20:10 +0800 Subject: [PATCH 08/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=A1=A5=E7=BC=B4?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=8C=87=E5=AE=9A=E6=9C=88=E7=9A=84=E7=BC=B4?= =?UTF-8?q?=E7=BA=B3=E5=9F=BA=E6=95=B0=EF=BC=8C=E4=BC=98=E5=8C=96=E7=A9=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SIRepairServiceImpl.java | 35 ++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java index 943f955ac..d57186af5 100644 --- a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java @@ -87,12 +87,21 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { Map categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName); if (projects.contains(ProjectTypeEnum.ALL.getValue())) { - targetBaseMap.putAll(socialBaseMap); - targetBaseMap.putAll(fundBaseMap); - targetBaseMap.putAll(otherBaseMap); + if (socialBaseMap != null) { + targetBaseMap.putAll(socialBaseMap); + } + if (fundBaseMap != null) { + targetBaseMap.putAll(fundBaseMap); + } + if (otherBaseMap != null) { + targetBaseMap.putAll(otherBaseMap); + } + } if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { - targetBaseMap.putAll(socialBaseMap); + if (socialBaseMap != null) { + targetBaseMap.putAll(socialBaseMap); + } } if (!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { @@ -101,23 +110,33 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { if (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) { ICategoryPO insuranceCategoryPO = list.stream().filter(item -> SalaryI18nUtil.getI18nLabel(93113, "养老保险").equals(item.getInsuranceName())).findFirst() .get(); - targetBaseMap.put(insuranceCategoryPO.getId().toString(), socialBaseMap.get(insuranceCategoryPO.getId())); + + if (socialBaseMap != null && socialBaseMap.containsKey(insuranceCategoryPO.getId())) { + targetBaseMap.put(insuranceCategoryPO.getId().toString(), socialBaseMap.get(insuranceCategoryPO.getId())); + } + } if (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue())) { ICategoryPO insuranceCategoryPO = list.stream().filter(item -> SalaryI18nUtil.getI18nLabel(93114, "医疗保险").equals(item.getInsuranceName())).findFirst() .get(); - targetBaseMap.put(insuranceCategoryPO.getId().toString(), socialBaseMap.get(insuranceCategoryPO.getId())); + if (socialBaseMap != null && socialBaseMap.containsKey(insuranceCategoryPO.getId())) { + targetBaseMap.put(insuranceCategoryPO.getId().toString(), socialBaseMap.get(insuranceCategoryPO.getId())); + } } } if (projects.contains(ProjectTypeEnum.FUND.getValue())) { - targetBaseMap.putAll(fundBaseMap); + if (fundBaseMap != null) { + targetBaseMap.putAll(fundBaseMap); + } } if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { - targetBaseMap.putAll(otherBaseMap); + if (otherBaseMap != null) { + targetBaseMap.putAll(otherBaseMap); + } } List> resulit = new ArrayList(); From 17e6e9d9343e7cca0997d911189174158859797c Mon Sep 17 00:00:00 2001 From: sy Date: Tue, 3 Jan 2023 10:09:14 +0800 Subject: [PATCH 09/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=A1=A5=E7=BC=B4?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=8C=87=E5=AE=9A=E6=9C=88=E7=9A=84=E7=BC=B4?= =?UTF-8?q?=E7=BA=B3=E5=9F=BA=E6=95=B0=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=8A=80?= =?UTF-8?q?=E6=9C=AF=E5=AD=97=E7=AC=A6=E4=B8=B2=E5=88=A4=E7=A9=BA=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=80=E5=B1=9E=E7=A4=BE=E4=BF=9D=E7=B1=BB?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SIRepairServiceImpl.java | 68 ++++++++++++++++--- 1 file changed, 59 insertions(+), 9 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java index d57186af5..80794e272 100644 --- a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java @@ -21,6 +21,7 @@ import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.google.common.collect.Maps; +import org.apache.commons.lang3.StringUtils; import java.util.*; import java.util.stream.Collectors; @@ -85,6 +86,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { List allCategoryList = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); Map categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName); + Map welfareTypeMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getWelfareType); if (projects.contains(ProjectTypeEnum.ALL.getValue())) { if (socialBaseMap != null) { @@ -148,6 +150,8 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { map.put("insuranceName", categoryNameMap.get(Long.valueOf(entry.getKey()))); map.put("insuranceBase", entry.getValue()); + String welfareTypeName = welfareTypeMap.get(Long.valueOf(entry.getKey())) == 1 ? "社保" : (welfareTypeMap.get(Long.valueOf(entry.getKey())) == 2 ? "公积金" : "企业年金及其它福利" ); + map.put("title", welfareTypeName); resulit.add(map); } } @@ -200,15 +204,21 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { List allCategoryList = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); Map categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName); + Map welfareTypeMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getWelfareType); List> resultList = new ArrayList<>(); if (projects.contains(ProjectTypeEnum.ALL.getValue())) { - if (socialSchemePO != null) { + if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) { Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); 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", "个人"); @@ -222,11 +232,16 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { }); } - if (fundSchemePO != null) { + if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) { Map fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap().getClass()); 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", "个人"); @@ -240,11 +255,16 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { }); } - if (otherSchemePO != null) { + if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) { Map otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap().getClass()); 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", "个人"); @@ -260,12 +280,17 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { return resultList; } if (projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { - if (socialSchemePO != null) { + if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) { Map socialMap = JSON.parseObject(socialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); 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", "个人"); @@ -283,13 +308,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { if ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) && (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) && (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) { - if (socialSchemePO != null) { + if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) { 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<>(); + + 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", "个人"); @@ -307,7 +337,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { if ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) && (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) && (!projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) { - if (socialSchemePO != null) { + if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) { 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)); @@ -315,6 +345,11 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { 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", "个人"); @@ -332,13 +367,18 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { if ((!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) && (!projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) && (projects.contains(ProjectTypeEnum.MEDICAL_INSURANCE.getValue()))) { - if (socialSchemePO != null) { + if (socialSchemePO != null && StringUtils.isNotBlank(socialSchemePO.getSocialPaymentBaseString())) { 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<>(); + + 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", "个人"); @@ -354,12 +394,17 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { } } if (projects.contains(ProjectTypeEnum.FUND.getValue())) { - if (fundSchemePO != null) { + if (fundSchemePO != null && StringUtils.isNotBlank(fundSchemePO.getFundPaymentBaseString())) { Map fundMap = JSON.parseObject(fundSchemePO.getFundPaymentBaseString(), new HashMap().getClass()); 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", "个人"); @@ -375,12 +420,17 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { } } if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { - if (otherSchemePO != null) { + if (otherSchemePO != null && StringUtils.isNotBlank(otherSchemePO.getOtherPaymentBaseString())) { Map otherMap = JSON.parseObject(otherSchemePO.getOtherPaymentBaseString(), new HashMap().getClass()); 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", "个人"); From f53d7885833541cab39e5dce03a839fe12cd1b63 Mon Sep 17 00:00:00 2001 From: sy Date: Tue, 3 Jan 2023 17:58:14 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E9=AB=98=E7=BA=A7?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=E6=94=AF=E6=8C=81=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E4=B8=AA=E7=A8=8E=E6=89=A3=E7=BC=B4=E4=B9=89=E5=8A=A1?= =?UTF-8?q?=E4=BA=BA=E6=A3=80=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 21 +++++++++++++++++++ .../param/InsuranceArchivesListParam.java | 2 ++ .../mapper/siarchives/SocialSchemeMapper.xml | 9 ++++++++ 3 files changed, 32 insertions(+) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index e8a5dc5eb..b75a88ac4 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -12,6 +12,7 @@ import com.cloudstore.eccom.pc.table.WeaTable; import com.cloudstore.eccom.pc.table.WeaTableCheckboxpopedom; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.cloudstore.eccom.result.WeaResultMsg; +import com.engine.common.util.ServiceUtil; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.AESEncryptUtil; import com.engine.salary.encrypt.EncryptUtil; @@ -45,6 +46,7 @@ import com.engine.salary.util.SalaryFormItemUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; +import com.engine.salary.wrapper.TaxAgentWrapper; import com.google.common.collect.Lists; import dm.jdbc.util.IdGenerator; import lombok.Data; @@ -104,6 +106,10 @@ public class SIArchivesBiz { return MapperProxyFactory.getProxy(OtherSchemeMapper.class); } + private TaxAgentWrapper getTaxAgentWrapper(User user) { + return ServiceUtil.getService(TaxAgentWrapper.class, user); + } + /** * @param welfareType * @param employeeId @@ -917,6 +923,8 @@ public class SIArchivesBiz { request.setRunStatuses(param.getRunStatuses()); + request.setTaxAgentId(param.getTaxAgentId()); + apidatas = listPageEmployeePOS(request, operateId); return apidatas; @@ -1294,6 +1302,9 @@ public class SIArchivesBiz { .collect(Collectors.toList()) .stream().map(item -> new SearchConditionOption(item.getId().toString(), item.getSchemeName())).collect(Collectors.toList()); + List> taxAgentList = getTaxAgentWrapper(user).selectListAsAdmin(); + List taxAgentOption = taxAgentList.stream().map(item -> new SearchConditionOption(item.get("id").toString(), item.get("content").toString())).collect(Collectors.toList()); + Map apidatas = new HashMap(); ConditionFactory conditionFactory = new ConditionFactory(user); @@ -1412,6 +1423,16 @@ public class SIArchivesBiz { otherSchemeId.setLabel("其它福利方案"); conditionItems.add(otherSchemeId); + SearchConditionItem taxAgentId = conditionFactory.createCondition(ConditionType.SELECT, 502327, "taxAgentId"); + taxAgentId.setInputType("select"); + taxAgentId.setOptions(taxAgentOption); + taxAgentId.setColSpan(2); + taxAgentId.setFieldcol(16); + taxAgentId.setLabelcol(8); + taxAgentId.setIsQuickSearch(true); + taxAgentId.setLabel("个税扣缴义务人"); + conditionItems.add(taxAgentId); + addGroups.add(new SearchConditionGroup("常用条件", true, conditionItems)); apidatas.put("condition", addGroups); return apidatas; diff --git a/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesListParam.java b/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesListParam.java index 2fd3bf1cc..ad05e9702 100644 --- a/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesListParam.java +++ b/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesListParam.java @@ -105,6 +105,8 @@ public class InsuranceArchivesListParam extends BaseQueryParam { private Collection taxAgentEmployeeIds; //个税扣缴义务人 private Collection taxAgentIds; + //个税扣缴义务人id + private Long taxAgentId; //福利执行状态 private List runStatuses; diff --git a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml index 329ecfb70..1d3f9f49d 100644 --- a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml @@ -421,6 +421,9 @@ AND otherSchemeId = #{param.otherSchemeId} + + AND base.payment_organization = #{param.taxAgentId} + AND base.run_status IN @@ -501,6 +504,9 @@ AND otherSchemeId = #{param.otherSchemeId} + + AND base.payment_organization = #{param.taxAgentId} + AND base.run_status IN @@ -580,6 +586,9 @@ AND otherSchemeId = #{param.otherSchemeId} + + AND base.payment_organization = #{param.taxAgentId} + AND base.run_status IN From 5f59ff399df14179a5767c28d73818eb03fb18ef Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 4 Jan 2023 16:05:19 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=A1=A5=E7=BC=B4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96=E5=8F=AA=E9=80=89=E7=A4=BE?= =?UTF-8?q?=E4=BF=9D=E6=88=96=E5=85=BB=E8=80=81=E4=BF=9D=E9=99=A9=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E5=8D=95=E4=BD=8D=E7=BC=B4=E7=BA=B3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 3739c9d6c..343564872 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -1500,11 +1500,17 @@ public class SIAccountBiz extends Service { //需要核算社保的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { - archivesCom.forEach((id, value) -> { - if (schemeCom.containsKey(Long.valueOf(id))) { - needArchivesCom.add(Long.valueOf(id)); + categoryIds.forEach(item -> { + if (archivesCom.containsKey(String.valueOf(item)) && schemeCom.containsKey(item)) { + needArchivesCom.add(item); } }); + +// archivesCom.forEach((id, value) -> { +// if (schemeCom.containsKey(Long.valueOf(id))) { +// needArchivesCom.add(Long.valueOf(id)); +// } +// }); } List socialCom = new ArrayList<>(); From b786de5e4d70f11f88e4ce40ce9b0008a6fa0847 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 4 Jan 2023 16:30:37 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=EF=BC=8C=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index b75a88ac4..22665b1c6 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -986,9 +986,9 @@ public class SIArchivesBiz { log.info("buildTableData方法处理福利档案列表数据开始"); sw.start("buildTableData方法处理福利档案列表数据"); if (param.getExportData() != null && param.getExportData()) { - records = buildTableData(page, true); + records = buildTableData(pageInfo.getList(), true); } else { - records = buildTableData(page, false); + records = buildTableData(pageInfo.getList(), false); } sw.stop(); log.info("buildTableData方法处理福利档案列表数据完成!"); From d25fc4a57979baf59b6e97856bce783a0fe8a60d Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 4 Jan 2023 17:41:09 +0800 Subject: [PATCH 13/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=B0=83=E5=B7=AE?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E9=85=8D=E7=BD=AE=E6=95=B0=E6=8D=AE=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../engine/salary/service/impl/SICompensationServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java index df6bf7d56..3130377dc 100644 --- a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java +++ b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java @@ -545,7 +545,8 @@ public class SICompensationServiceImpl extends Service implements SICompensation //设置targetOptions Map targetOptions = new HashMap<>(); targetOptions.put("name", usernameMap.get(configPO.getEmployeeId())); - String target = detailPOMap.get(configPO.getEmployeeId()).getId().toString(); +// String target = detailPOMap.get(configPO.getEmployeeId()).getId().toString(); + String target = detailPOMap.get(configPO.getEmployeeId()) == null ? null : detailPOMap.get(configPO.getEmployeeId()).getId().toString(); if (target == null) { continue; } else { From 8e0bf2b693beb9fabeaf8024b98b4aca597d5f04 Mon Sep 17 00:00:00 2001 From: fcli Date: Thu, 5 Jan 2023 09:25:07 +0800 Subject: [PATCH 14/18] =?UTF-8?q?feat:=20=E5=BE=80=E6=9C=9F=E7=B4=AF?= =?UTF-8?q?=E8=AE=A1=E4=B8=80=E9=94=AE=E6=B8=85=E7=A9=BA=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/AddUpSituationServiceImpl.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index a26a9c801..9205ef09d 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -56,6 +56,7 @@ import java.io.InputStream; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.YearMonth; +import java.time.format.DateTimeFormatter; import java.util.*; import java.util.stream.Collectors; @@ -1026,7 +1027,10 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation List deleteIds = deleteParam.getIds(); // 已经核算过的不可操作 // 获取已经核算的数据 - List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr); + LocalDate salaryMonthDate = LocalDate.parse(declareMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER); + salaryMonthDate = salaryMonthDate.plusMonths(1); + String format = salaryMonthDate.atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM")); + List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(format); // 判断是否有核算过 List deleteList = new ArrayList<>(); for(int i=0; i Objects.equals(t , taxAgentId)); @@ -1085,8 +1089,10 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 获取所有想要删除的数据 List list = biz.listSome(queryParam); + LocalDate salaryMonthDate = LocalDate.parse(declareMonthStr + "-01", SalaryDateUtil.DATE_FORMATTER); + String format = salaryMonthDate.plusMonths(1).atStartOfDay().format(DateTimeFormatter.ofPattern("yyyy-MM")); // 获取已经核算的数据 - List employees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr); + List employees = getAddUpDeductionService(user).getAccountedEmployeeData(format); for(AddUpSituation item : list){ if (CollectionUtils.isNotEmpty(employees)) { Optional optionalAcctEmp = employees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst(); From eb3c75197b858465a0e6fe2fc37a1a32cbbd7171 Mon Sep 17 00:00:00 2001 From: fcli Date: Thu, 5 Jan 2023 09:40:43 +0800 Subject: [PATCH 15/18] =?UTF-8?q?feat:=20=E5=BE=80=E6=9C=9F=E7=B4=AF?= =?UTF-8?q?=E8=AE=A1=E4=B8=80=E9=94=AE=E6=B8=85=E7=A9=BA=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/AddUpDeductionService.java | 2 ++ .../impl/AddUpDeductionServiceImpl.java | 25 +++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/AddUpDeductionService.java b/src/com/engine/salary/service/AddUpDeductionService.java index 88f7c3898..51498f653 100644 --- a/src/com/engine/salary/service/AddUpDeductionService.java +++ b/src/com/engine/salary/service/AddUpDeductionService.java @@ -109,6 +109,8 @@ public interface AddUpDeductionService { */ List getAccountedEmployeeData(String yearMonth); + List getAccountedEmployeeDataByTaxYearMonth(String yearMonth); + /** * @description 编辑累计专项附加扣除 * @return void diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index 97b8afa01..9d0de576c 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -546,7 +546,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction List deleteIds = deleteParam.getIds(); // 已经核算过的不可操作 // 获取已经核算的数据 - List salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr); + List salaryAcctEmployees = getAccountedEmployeeDataByTaxYearMonth(declareMonthStr); // 判断是否有核算过 List deleteList = new ArrayList<>(); for (int i = 0; i < deleteIds.size(); i++) { @@ -604,7 +604,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction // 获取所有想要删除的数据 List list = addUpDeductionBiz.list(queryParam); // 获取已经核算的数据 - List salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr); + List salaryAcctEmployees = getAccountedEmployeeDataByTaxYearMonth(declareMonthStr); for (AddUpDeductionDTO item : list) { if (CollectionUtils.isNotEmpty(salaryAcctEmployees)) { Optional optionalAcctEmp = salaryAcctEmployees.stream().filter(f -> f.getEmployeeId().equals(item.getEmployeeId()) && f.getTaxAgentId().equals(item.getTaxAgentId())).findFirst(); @@ -1176,4 +1176,25 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction return list; } + @Override + public List getAccountedEmployeeDataByTaxYearMonth(String yearMonth) { + List list = Lists.newArrayList(); + YearMonth month = YearMonth.parse(yearMonth); + LocalDate salaryMonthDate = month.atDay(1); + LocalDate salaryMonthEndDate = month.atEndOfMonth(); + List salaryAcctRecords = getSalaryAcctRecordService(user).listByTaxCycle( + LocalDateRange.builder().fromDate(SalaryDateUtil.localDateToDate(salaryMonthDate)) + .endDate(SalaryDateUtil.localDateToDate(salaryMonthEndDate)).build(), + null); + salaryAcctRecords.forEach(e -> { + boolean isAccounted = e.getStatus() > SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue(); + if (isAccounted) { +// list.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecords.get(0).getId()))); + list.addAll(getSalaryAcctEmployeeService(user).listBySalaryAcctRecordIds(Collections.singleton(e.getId()))); + } + }); + + return list; + } + } From 2d9ce61d5de9eef105583a7192b9d4cd4c2a8605 Mon Sep 17 00:00:00 2001 From: fcli Date: Thu, 5 Jan 2023 09:49:25 +0800 Subject: [PATCH 16/18] =?UTF-8?q?feat:=20=E5=BE=80=E6=9C=9F=E7=B4=AF?= =?UTF-8?q?=E8=AE=A1=E4=B8=80=E9=94=AE=E6=B8=85=E7=A9=BA=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D,=E5=88=86=E9=A1=B5=E8=A7=A3=E5=AF=86?= =?UTF-8?q?=E6=97=B6=E6=9C=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/AddUpSituationServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index 9205ef09d..622624f21 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -201,8 +201,9 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation queryParam.setTaxAgentIds(taxAgentIdsAsAdmin); } List list = getAddUpSituationMapper().list(queryParam); - encryptUtil.decryptList(list, AddUpSituationDTO.class); - return SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AddUpSituationDTO.class); + PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AddUpSituationDTO.class); + encryptUtil.decryptList(page.getList(), AddUpSituationDTO.class); + return page; } From ac99625e29b333b21a42cc22108bd0b224108be7 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 5 Jan 2023 09:53:26 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E5=8F=B0=E8=B4=A6=EF=BC=8C=E8=A1=A5=E7=BC=B4?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A4=BE=E4=BF=9D=E7=BC=B4=E7=BA=B3=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E4=BF=9D=E5=AD=98=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 343564872..a4ef201e7 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -1115,7 +1115,7 @@ public class SIAccountBiz extends Service { } accountSocial(insuranceAccountDetailPO, accountPO); } else if ("3".equals(baseParam.getSupplementType())) { -// accountSocialByData(insuranceAccountDetailPO, baseParam); + accountSocialByData(insuranceAccountDetailPO, baseParam); } else { accountSocial(insuranceAccountDetailPO, accountPO); } From dc08340c73d8cff479d9c5b30bc068479ad1e39f Mon Sep 17 00:00:00 2001 From: Harryxzy Date: Thu, 5 Jan 2023 11:50:01 +0800 Subject: [PATCH 18/18] =?UTF-8?q?fix=E4=B8=AA=E7=A8=8E=E7=94=B3=E6=8A=A5?= =?UTF-8?q?=E5=90=8E=E6=97=A0=E6=B3=95=E9=87=8D=E6=96=B0=E6=A0=B8=E7=AE=97?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SalaryAcctRecordServiceImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java index e04d45b20..713185ddf 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctRecordServiceImpl.java @@ -654,11 +654,14 @@ public class SalaryAcctRecordServiceImpl extends Service implements SalaryAcctRe List needUpdateSalaryAcctRecordIds = selfSalaryAcctRecordPOS.stream().filter(po -> po.getTaxCycle().equals(salaryAcctRecordPO.getTaxCycle())) .map(SalaryAcctRecordPO::getId).collect(Collectors.toList()); if (Objects.equals(salaryAcctRecordPO.getStatus(), SalaryAcctRecordStatusEnum.DECLARED.getValue())) { - // 更新薪资核算记录的状态 - updateStatusByIds(needUpdateSalaryAcctRecordIds, SalaryAcctRecordStatusEnum.ARCHIVED); + if(needUpdateSalaryAcctRecordIds != null && needUpdateSalaryAcctRecordIds.size()>0){ + // 更新薪资核算记录的状态 + updateStatusByIds(needUpdateSalaryAcctRecordIds, SalaryAcctRecordStatusEnum.ARCHIVED); + } + // 删除个税申报表及往期累计情况 + getTaxDeclarationService(user).delete(salaryAcctRecordPO); } - // 删除个税申报表及往期累计情况 - getTaxDeclarationService(user).delete(salaryAcctRecordPO); + // 更新薪资核算记录的状态 salaryAcctRecordPO.setStatus(SalaryAcctRecordStatusEnum.NOT_ARCHIVED.getValue()); salaryAcctRecordPO.setUpdateTime(new Date());