From b10a45ebda509eda890838eb9d2a808122092331 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 24 Jul 2023 10:57:34 +0800 Subject: [PATCH 1/9] =?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?=E4=B8=8D=E8=A6=81=E6=98=BE=E7=A4=BA=E5=90=88=E5=90=8C=E5=88=B0?= =?UTF-8?q?=E6=9C=9F=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 51da1aa57..1e5863af8 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -1078,7 +1078,7 @@ public class SIArchivesBiz { list.add(new WeaTableColumn("150px", "工号", "jobNum")); list.add(new WeaTableColumn("150px", "入职日期", "companystartdate")); - list.add(new WeaTableColumn("150px", "合同到期日期", "dismissdate")); +// list.add(new WeaTableColumn("150px", "合同到期日期", "dismissdate")); list.add(new WeaTableColumn("150px", "社保方案名称", "socialName")); titleMap.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> list.add(new WeaTableColumn("150px", v, k))); From ea4b603c36d503c86cc305f2d2ce170ba3ddc779 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 24 Jul 2023 11:26:36 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E6=A1=A3=E6=A1=88=E3=80=81=E6=A0=B8=E7=AE=97?= =?UTF-8?q?=EF=BC=8C=E5=88=97=E8=A1=A8=E4=B8=8D=E8=A6=81=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=A6=BB=E8=81=8C=E6=97=A5=E6=9C=9F=E3=80=81=E6=A0=B8=E7=AE=97?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=A1=AE=E8=AE=A4=E9=A1=B5=E9=9D=A2=E8=8C=83?= =?UTF-8?q?=E5=9B=B4=E5=88=97=E8=A1=A8=E4=B8=8D=E8=A6=81=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=A6=BB=E8=81=8C=E6=97=A5=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salaryacct/dto/SalaryAccEmployeeListDTO.java | 2 +- .../entity/salaryarchive/bo/SalaryArchiveBO.java | 2 +- .../service/impl/SalaryAcctExcelServiceImpl.java | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/com/engine/salary/entity/salaryacct/dto/SalaryAccEmployeeListDTO.java b/src/com/engine/salary/entity/salaryacct/dto/SalaryAccEmployeeListDTO.java index 3f067cb1c..5f9d256f8 100644 --- a/src/com/engine/salary/entity/salaryacct/dto/SalaryAccEmployeeListDTO.java +++ b/src/com/engine/salary/entity/salaryacct/dto/SalaryAccEmployeeListDTO.java @@ -66,6 +66,6 @@ public class SalaryAccEmployeeListDTO { private String hireDate; //离职日期 - @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") +// @TableTitle(title = "离职日期", dataIndex = "dismissDate", key = "dismissDate") private String dismissDate; } diff --git a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java index 555c2a1cb..552856821 100644 --- a/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java +++ b/src/com/engine/salary/entity/salaryarchive/bo/SalaryArchiveBO.java @@ -82,7 +82,7 @@ public class SalaryArchiveBO { columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86187, "起始发薪日期"), "payStartDate")); columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86187, "最后发薪日期"), "payEndDate")); columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86187, "入职日期"), "companystartdate").setDisplay(WeaBoolAttr.FALSE)); - columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86187, "离职日期"), "dismissdate").setDisplay(WeaBoolAttr.FALSE)); +// columns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(86187, "离职日期"), "dismissdate").setDisplay(WeaBoolAttr.FALSE)); for (SalaryItemPO salaryItem : salaryItems) { columns.add(new WeaTableColumn("100px", salaryItem.getName(), salaryItem.getId() + SalaryItemConstant.DYNAMIC_SUFFIX)); } diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 3e808cb80..7dad4d050 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -154,8 +154,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(86186, "工号"), SalaryI18nUtil.getI18nLabel(91075, "员工状态"), - SalaryI18nUtil.getI18nLabel(91075, "入职日期"), - SalaryI18nUtil.getI18nLabel(91075, "离职日期") + SalaryI18nUtil.getI18nLabel(91075, "入职日期") +// SalaryI18nUtil.getI18nLabel(91075, "离职日期") }; List headerList = new ArrayList<>(Arrays.asList(header)); // 查询薪资核算人员 @@ -187,8 +187,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(86186, "工号"), SalaryI18nUtil.getI18nLabel(91075, "员工状态"), - SalaryI18nUtil.getI18nLabel(91075, "入职日期"), - SalaryI18nUtil.getI18nLabel(91075, "离职日期") + SalaryI18nUtil.getI18nLabel(91075, "入职日期") +// SalaryI18nUtil.getI18nLabel(91075, "离职日期") }; List headerList = new ArrayList<>(Arrays.asList(header)); // 查询薪资核算人员(环比上月减少) @@ -219,8 +219,8 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(86186, "工号"), SalaryI18nUtil.getI18nLabel(91075, "员工状态"), - SalaryI18nUtil.getI18nLabel(91075, "入职日期"), - SalaryI18nUtil.getI18nLabel(91075, "离职日期") + SalaryI18nUtil.getI18nLabel(91075, "入职日期") +// SalaryI18nUtil.getI18nLabel(91075, "离职日期") }; List headerList = new ArrayList<>(Arrays.asList(header)); // 查询薪资核算人员(环比上月增加) @@ -263,7 +263,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc row.add(dto.getJobNum()); row.add(dto.getStatus()); row.add(dto.getHireDate()); - row.add(dto.getDismissDate()); +// row.add(dto.getDismissDate()); rows.add(row); } return rows; From 174941ea638f20f0f8ae58cabad5039df100a0e3 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 24 Jul 2023 16:39:48 +0800 Subject: [PATCH 3/9] =?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=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AF=B9=E4=BA=8E=E5=AD=98=E5=9C=A8=E5=86=97?= =?UTF-8?q?=E4=BD=99=E6=95=B0=E6=8D=AE=E7=9A=84=E6=83=85=E5=86=B5=EF=BC=8C?= =?UTF-8?q?=E5=88=A9=E7=94=A8=E5=BD=93=E5=89=8D=E7=BC=96=E8=BE=91=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=EF=BC=8C=E6=96=B0=E5=BB=BA=E5=AF=B9=E5=BA=94=E6=A1=A3?= =?UTF-8?q?=E6=A1=88=E5=B9=B6=E4=B8=8Ebase=5Finfo=E8=A1=A8=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E5=85=B3=E8=81=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 157 ++++++++++++++++-- .../mapper/siarchives/FundSchemeMapper.java | 6 + .../mapper/siarchives/FundSchemeMapper.xml | 41 +++++ .../siarchives/InsuranceBaseInfoMapper.java | 7 + .../siarchives/InsuranceBaseInfoMapper.xml | 19 +++ .../mapper/siarchives/OtherSchemeMapper.java | 6 + .../mapper/siarchives/OtherSchemeMapper.xml | 35 ++++ .../mapper/siarchives/SocialSchemeMapper.java | 6 + .../mapper/siarchives/SocialSchemeMapper.xml | 38 +++++ 9 files changed, 297 insertions(+), 18 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 51da1aa57..b4157ad56 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -662,11 +662,10 @@ public class SIArchivesBiz { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(542533, "其他福利最后缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); } -// List oldOtherInfoList = otherSchemeMapper.getOtherByEmployeeId(Collections.singletonList(param.getEmployeeId())); - List oldOtherInfoList = otherSchemeMapper.getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() - .employeeId(param.getEmployeeId()) - .paymentOrganization(param.getPaymentOrganization()) - .build()); + List otherIds = new ArrayList(); + otherIds.add(param.getId()); + List oldOtherInfoList = otherSchemeMapper.getOtherById(otherIds); + if (oldOtherInfoList.size() == 1) { InsuranceArchivesOtherSchemePO oldOtherInfo = oldOtherInfoList.get(0); InsuranceArchivesOtherSchemePO updateOtherInfo = @@ -694,7 +693,48 @@ public class SIArchivesBiz { otherSchemeMapper.updateById(updateOtherInfo); sqlSession.commit(); } else { - throw new SalaryRunTimeException("该员工已关联的其他福利档案不存在或存在多条,请处理后再重复当前操作!"); + otherSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesOtherSchemePO.builder() + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build()); + //新建社保档案,并关联主表 + InsuranceArchivesOtherSchemePO insertOtherInfo = InsuranceArchivesOtherSchemePO.builder() + .otherSchemeId(param.getOtherSchemeId()) + .otherStartTime(StringUtils.isNotBlank(param.getOtherStartTime()) ? param.getOtherStartTime() : null) + .underTake(param.getUnderTake()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .welfareType(paramReq.getWelfareType().getValue()) + .otherEndTime(StringUtils.isNotBlank(param.getOtherEndTime()) ? param.getOtherEndTime() : null) + .employeeId(param.getEmployeeId()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .createTime(new Date()) + .updateTime(new Date()) + .nonPayment(param.getNonPayment()) + .creator(employeeId) + .paymentOrganization(param.getPaymentOrganization()) + .otherPaymentBaseString(paramReq.getPaymentForm()) + .build(); + //校验福利基数是否符合上下限要求, + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString())) { + throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + encryptUtil.encrypt(insertOtherInfo, InsuranceArchivesOtherSchemePO.class); + otherSchemeMapper.insert(insertOtherInfo); + sqlSession.commit(); + + InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(param.getPaymentOrganization(), param.getEmployeeId()); + if(baseInfoPO != null) { + List otherInfos = otherSchemeMapper.getOtherByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build()); + baseInfoPO.setOtherArchivesId(otherInfos.get(0).getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); + } else { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "档案不存在!")); + } + + } } finally { @@ -720,11 +760,10 @@ public class SIArchivesBiz { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(542531, "公积金最后缴纳时间格式错误,正确格式为YYYY-MM或者yyyy-MM-dd")); } -// List oldFundInfoList = fundSchemeMapper.getFundByEmployeeId(Collections.singletonList(param.getEmployeeId())); - List oldFundInfoList = fundSchemeMapper.getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() - .employeeId(param.getEmployeeId()) - .paymentOrganization(param.getPaymentOrganization()) - .build()); + List fundIds = new ArrayList(); + fundIds.add(param.getId()); + List oldFundInfoList = fundSchemeMapper.getFundById(fundIds); + if (oldFundInfoList.size() == 1) { InsuranceArchivesFundSchemePO oldFundInfo = oldFundInfoList.get(0); InsuranceArchivesFundSchemePO updateFundInfo = InsuranceArchivesFundSchemePO.builder() @@ -754,7 +793,49 @@ public class SIArchivesBiz { sqlSession.commit(); } else { - throw new SalaryRunTimeException("该员工已关联的公积金档案不存在或存在多条,请处理后再重复当前操作!"); + fundSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesFundSchemePO.builder() + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build()); + //新建社保档案,并关联主表 + InsuranceArchivesFundSchemePO insertFundInfo = InsuranceArchivesFundSchemePO.builder() + .fundSchemeId(param.getFundSchemeId()) + .fundAccount(param.getFundAccount()) + .fundEndTime(StringUtils.isNotBlank(param.getFundEndTime()) ? param.getFundEndTime() : null) + .fundStartTime(StringUtils.isNotBlank(param.getFundStartTime()) ? param.getFundStartTime() : null) + .fundPaymentBaseString(paramReq.getPaymentForm()) + .supplementFundAccount(param.getSupplementFundAccount()) + .creator(employeeId) + .nonPayment(param.getNonPayment()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .underTake(param.getUnderTake()) + .paymentOrganization(param.getPaymentOrganization()) + .createTime(new Date()) + .updateTime(new Date()) + .welfareType(paramReq.getWelfareType().getValue()) + .employeeId(param.getEmployeeId()) + .build(); + //校验福利基数是否符合上下限要求, + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString())) { + throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + encryptUtil.encrypt(insertFundInfo, InsuranceArchivesFundSchemePO.class); + fundSchemeMapper.insert(insertFundInfo); + sqlSession.commit(); + + InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(param.getPaymentOrganization(), param.getEmployeeId()); + if(baseInfoPO != null) { + List fundInfos = fundSchemeMapper.getFundByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build()); + baseInfoPO.setFundArchivesId(fundInfos.get(0).getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); + } else { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "档案不存在!")); + } + } } finally { @@ -787,11 +868,9 @@ public class SIArchivesBiz { // socialSchemeMapper.batchDeleteByEmployeeIds(Collections.singletonList(param.getEmployeeId())); //查询已有数据 -// List oldSocialInfoList = socialSchemeMapper.getSocialByEmployeeId(Collections.singletonList(param.getEmployeeId())); - List oldSocialInfoList = socialSchemeMapper.getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() - .employeeId(param.getEmployeeId()) - .paymentOrganization(param.getPaymentOrganization()) - .build()); + List socialIds = new ArrayList(); + socialIds.add(param.getId()); + List oldSocialInfoList = socialSchemeMapper.getSocialById(socialIds); //组装新数据 if (oldSocialInfoList.size() == 1) { InsuranceArchivesSocialSchemePO oldSocialInfo = oldSocialInfoList.get(0); @@ -823,7 +902,49 @@ public class SIArchivesBiz { sqlSession.commit(); } else { - throw new SalaryRunTimeException("该员工已关联的社保档案不存在或存在多条,请处理后再重复当前操作!"); + socialSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesSocialSchemePO.builder() + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build()); + //新建社保档案,并关联主表 + InsuranceArchivesSocialSchemePO insertSocialInfo = + InsuranceArchivesSocialSchemePO.builder() + .welfareType(paramReq.getWelfareType().getValue()) + .deleteType(DeleteTypeEnum.NOT_DELETED.getValue()) + .socialPaymentBaseString(paramReq.getPaymentForm()) + .socialSchemeId(param.getSocialSchemeId()) + .socialEndTime(StringUtils.isNotBlank(param.getSocialEndTime()) ? param.getSocialEndTime() : null) + .socialStartTime(StringUtils.isNotBlank(param.getSocialStartTime()) ? param.getSocialStartTime() : null) + .creator(employeeId) + .nonPayment(param.getNonPayment()) + .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY) + .employeeId(param.getEmployeeId()) + .createTime(new Date()) + .updateTime(new Date()) + .underTake(param.getUnderTake()) + .socialAccount(param.getSchemeAccount()) + .paymentOrganization(param.getPaymentOrganization()) + .build(); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString())) { + throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + encryptUtil.encrypt(insertSocialInfo, InsuranceArchivesSocialSchemePO.class); + socialSchemeMapper.insert(insertSocialInfo); + sqlSession.commit(); + + InsuranceArchivesBaseInfoPO baseInfoPO = getInsuranceBaseInfoMapper().getOneByEmployeeIdAndPayOrg(param.getPaymentOrganization(), param.getEmployeeId()); + if(baseInfoPO != null) { + List socialInfos = socialSchemeMapper.getSocialByEmployeeIdAndPayOrg(InsuranceArchivesEmployeePO.builder() + .employeeId(param.getEmployeeId()) + .paymentOrganization(param.getPaymentOrganization()) + .build()); + baseInfoPO.setSocialArchivesId(socialInfos.get(0).getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); + } else { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "档案不存在!")); + } + } } finally { diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.java b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.java index 558d84eb0..ca0cb78fb 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.java +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.java @@ -85,4 +85,10 @@ public interface FundSchemeMapper { * @param fundArchiveDelIds */ void deleteByIds(@Param("ids")List fundArchiveDelIds); + + /** + * 新增 + * @param insuranceArchivesFundSchemePO + */ + void insert(InsuranceArchivesFundSchemePO insuranceArchivesFundSchemePO); } diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml index 17416d13c..8590a88e6 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml @@ -327,4 +327,45 @@ + + + + INSERT INTO hrsa_fund_archives( + fund_scheme_id, + fund_account, + fund_end_time, + fund_start_time, + fund_payment_base_string, + supplement_fund_account, + create_time, + creator, + non_payment, + delete_type, + tenant_key, + under_take, + payment_organization, + update_time, + welfare_type, + employee_id) + VALUES + ( + #{fundSchemeId}, + #{fundAccount}, + #{fundEndTime}, + #{fundStartTime}, + #{fundPaymentBaseString}, + #{supplementFundAccount}, + #{createTime}, + #{creator}, + #{nonPayment}, + #{deleteType}, + #{tenantKey}, + #{underTake}, + #{paymentOrganization}, + #{updateTime}, + #{welfareType}, + #{employeeId} + ) + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.java b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.java index 4f308f1b4..b604d49ef 100644 --- a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.java +++ b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.java @@ -113,4 +113,11 @@ public interface InsuranceBaseInfoMapper { * @param archiveDelIds */ void deleteByIds(@Param("ids")List archiveDelIds); + + /** + * 根据id更新 + * + * @param po + */ + void updateById(InsuranceArchivesBaseInfoPO po); } diff --git a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml index 2d63845b8..252c1dd70 100644 --- a/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/InsuranceBaseInfoMapper.xml @@ -318,4 +318,23 @@ + + UPDATE hrsa_insurance_base_info + + + employee_id = #{employeeId}, + payment_organization = #{paymentOrganization}, + social_archives_id = #{socialArchivesId}, + fund_archives_id = #{fundArchivesId}, + other_archives_id = #{otherArchivesId}, + run_status = #{runStatus}, + create_time = #{createTime}, + update_time = #{updateTime}, + creator = #{creator}, + delete_type = #{deleteType}, + tenant_key = #{tenantKey}, + + WHERE id = #{id} + + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.java b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.java index 80d9785f4..26d684d21 100644 --- a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.java +++ b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.java @@ -77,4 +77,10 @@ public interface OtherSchemeMapper { * @param otherArchiveDelIds */ void deleteByIds(@Param("ids") List otherArchiveDelIds); + + /** + * 新增 + * @param insuranceArchivesOtherSchemePO + */ + void insert(InsuranceArchivesOtherSchemePO insuranceArchivesOtherSchemePO); } diff --git a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml index fcfd38706..74c514a6e 100644 --- a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml @@ -305,4 +305,39 @@ + + + INSERT INTO hrsa_other_archives( + other_scheme_id, + other_start_time, + under_take, + tenant_key, + welfare_type, + other_end_time, + employee_id, + delete_type, + update_time, + create_time, + non_payment, + creator, + payment_organization, + other_payment_base_string) + VALUES + ( + #{otherSchemeId}, + #{otherStartTime}, + #{underTake}, + #{tenantKey}, + #{welfareType}, + #{otherEndTime}, + #{employeeId}, + #{deleteType}, + #{updateTime}, + #{createTime}, + #{nonPayment}, + #{creator}, + #{paymentOrganization}, + #{otherPaymentBaseString} + ) + \ No newline at end of file diff --git a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.java b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.java index 28f1bc511..0c730ed15 100644 --- a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.java +++ b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.java @@ -113,4 +113,10 @@ public interface SocialSchemeMapper { * @param socialArchiveDelIds */ void deleteByIds(@Param("ids")List socialArchiveDelIds); + + /** + * 新增 + * @param insuranceArchivesSocialSchemePO + */ + void insert(InsuranceArchivesSocialSchemePO insuranceArchivesSocialSchemePO); } diff --git a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml index 10395159b..ebd5af0c3 100644 --- a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml @@ -709,4 +709,42 @@ + + + INSERT INTO hrsa_social_archives( + welfare_type, + delete_type, + social_payment_base_string, + social_scheme_id, + create_time, + social_end_time, + social_start_time, + creator, + non_payment, + tenant_key, + employee_id, + update_time, + under_take, + social_account, + payment_organization) + VALUES + ( + #{welfareType}, + #{deleteType}, + #{socialPaymentBaseString}, + #{socialSchemeId}, + #{createTime}, + #{socialEndTime}, + #{socialStartTime}, + #{creator}, + #{nonPayment}, + #{tenantKey}, + #{employeeId}, + #{updateTime}, + #{underTake}, + #{socialAccount}, + #{paymentOrganization} + ) + + \ No newline at end of file From 7969360e675e9b2c26a3c1342bc050cad308b1f4 Mon Sep 17 00:00:00 2001 From: sy Date: Tue, 25 Jul 2023 14:28:35 +0800 Subject: [PATCH 4/9] =?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=96=B9=E6=A1=88=EF=BC=8C=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=A6=8F=E5=88=A9=E9=A1=B9=E6=94=AF=E6=8C=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=BC=B4=E8=B4=B9=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/sicategory/ICategoryMapper.java | 6 +++++ .../mapper/sicategory/ICategoryMapper.xml | 11 +++++++++ .../salary/service/SICategoryService.java | 5 ++++ .../service/impl/SICategoryServiceImpl.java | 24 +++++++++++++++++++ .../salary/web/SICategoryController.java | 3 ++- 5 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/com/engine/salary/mapper/sicategory/ICategoryMapper.java b/src/com/engine/salary/mapper/sicategory/ICategoryMapper.java index cfc7d17ed..4ecd92480 100644 --- a/src/com/engine/salary/mapper/sicategory/ICategoryMapper.java +++ b/src/com/engine/salary/mapper/sicategory/ICategoryMapper.java @@ -70,6 +70,12 @@ public interface ICategoryMapper { */ void updateNameById(ICategoryPO iCategoryPO); + /** + * 根据id更新福利名称和缴费对象 + * @param iCategoryPO + */ + void updateNameAndPayScopeById(ICategoryPO iCategoryPO); + /** * 根据类型查询福利类型 * diff --git a/src/com/engine/salary/mapper/sicategory/ICategoryMapper.xml b/src/com/engine/salary/mapper/sicategory/ICategoryMapper.xml index 51529b92c..87845a20c 100644 --- a/src/com/engine/salary/mapper/sicategory/ICategoryMapper.xml +++ b/src/com/engine/salary/mapper/sicategory/ICategoryMapper.xml @@ -178,6 +178,17 @@ WHERE id = #{id} AND data_type = 0 + + + UPDATE hrsa_insurance_category + + update_time=#{updateTime}, + insurance_name=#{insuranceName}, + payment_scope=#{paymentScope}, + + WHERE id = #{id} AND data_type = 0 + + + + + UPDATE hrsa_insurance_category + + update_time=#{updateTime}, + delete_type = 1 + + WHERE id = #{id} AND delete_type = 0 AND data_type = 0 + \ No newline at end of file diff --git a/src/com/engine/salary/service/SICategoryService.java b/src/com/engine/salary/service/SICategoryService.java index e754a9f1e..dfaa84349 100644 --- a/src/com/engine/salary/service/SICategoryService.java +++ b/src/com/engine/salary/service/SICategoryService.java @@ -63,4 +63,6 @@ public interface SICategoryService { * @description 修改自定义福利 名称、缴费对象 */ Map updateCategoryNameAndPayScope(ICategoryFormDTO iCategoryFormDTO); + + Map deleteCustomCategory(ICategoryFormDTO iCategoryFormDTO); } diff --git a/src/com/engine/salary/service/impl/SICategoryServiceImpl.java b/src/com/engine/salary/service/impl/SICategoryServiceImpl.java index e3a4112d2..53f8b8d58 100644 --- a/src/com/engine/salary/service/impl/SICategoryServiceImpl.java +++ b/src/com/engine/salary/service/impl/SICategoryServiceImpl.java @@ -1,10 +1,12 @@ package com.engine.salary.service.impl; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.cmd.sicategory.SICategoryGetFormCmd; import com.engine.salary.cmd.sicategory.SICategoryInsertCmd; import com.engine.salary.cmd.sicategory.SICategoryUpdateCmd; import com.engine.salary.cmd.sicategory.SICategoryUpdateStatusByIdCmd; +import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; import com.engine.salary.entity.sicategory.dto.ICategoryDTO; import com.engine.salary.entity.sicategory.dto.ICategoryFormDTO; import com.engine.salary.entity.sicategory.dto.ICategoryListDTO; @@ -14,16 +16,20 @@ import com.engine.salary.enums.sicategory.DataTypeEnum; import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; 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.RecordsBuildService; import com.engine.salary.service.SICategoryService; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEnumUtil; +import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; +import weaver.hrm.User; import java.util.*; import java.util.stream.Collectors; @@ -40,6 +46,13 @@ public class SICategoryServiceImpl extends Service implements SICategoryService return MapperProxyFactory.getProxy(ICategoryMapper.class); } + private InsuranceAccountDetailMapper getInsuranceAccountDetailMapper() { + return MapperProxyFactory.getProxy(InsuranceAccountDetailMapper.class); + } + + public RecordsBuildService getRecordsBuildService(User user) { + return ServiceUtil.getService(RecordsBuildServiceImpl.class, user); + } @Override public Map getForm(Map params) { @@ -140,17 +153,17 @@ public class SICategoryServiceImpl extends Service implements SICategoryService public Map updateCategoryNameAndPayScope(ICategoryFormDTO iCategoryFormDTO) { ICategoryPO categoryPO = getICategoryMapper().getByIdAndDataType(iCategoryFormDTO.getId(), DataTypeEnum.CUSTOM.getValue()); if(categoryPO == null){ - throw new SalaryRunTimeException("自定义福利不存在"); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "自定义福利不存在")); } // 判断是否启用 Integer isUse = categoryPO.getIsUse(); if(isUse == 1){ - throw new SalaryRunTimeException("编辑失败,请先关闭启用按钮!"); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "编辑失败,请先关闭启用按钮!")); } // 判断福利名称是否重复 List iCategoryPOS = getICategoryMapper().listByName(iCategoryFormDTO.getInsuranceName()); if(CollectionUtils.isNotEmpty(iCategoryPOS)){ - throw new SalaryRunTimeException("福利名称不能重复"); + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "福利名称不能重复")); } ICategoryPO iCategoryPO = ICategoryPO.builder().id(iCategoryFormDTO.getId()).insuranceName(iCategoryFormDTO.getInsuranceName()) .paymentScope(SalaryEnumUtil.enumArrToString(iCategoryFormDTO.getPaymentScope())) @@ -160,6 +173,52 @@ public class SICategoryServiceImpl extends Service implements SICategoryService return null; } + @Override + public Map deleteCustomCategory(ICategoryFormDTO iCategoryFormDTO) { + ICategoryPO categoryPO = getICategoryMapper().getByIdAndDataType(iCategoryFormDTO.getId(), DataTypeEnum.CUSTOM.getValue()); + if(categoryPO == null){ + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "自定义福利不存在")); + } + // 判断是否启用 + Integer isUse = categoryPO.getIsUse(); + if(isUse == 1){ + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "删除失败,请先关闭启用按钮!")); + } + // 判断自定义福利项是否存在核算数据 + //获取所有福利核算数据 + List insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().listAll(); + //数据组装 + List> records = getRecordsBuildService(user).buildCommonRecords(insuranceAccountDetailPOS, null); + String welfareTypeName = ""; + switch (categoryPO.getWelfareType()) { + case 1: + welfareTypeName = "social"; + break; + case 2: + welfareTypeName = "fund"; + break; + case 3: + welfareTypeName = "other"; + break; + default: + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(542456, "福利类型不在")); + } + String welfareNameStart = categoryPO.getId() + welfareTypeName; + //校验福利项是否存在核算记录 + records.forEach(f -> { + if (StringUtils.isNotBlank(f.get(welfareNameStart + "Per").toString()) + || StringUtils.isNotBlank(f.get(welfareNameStart + "Com").toString()) + || StringUtils.isNotBlank(f.get(welfareNameStart + "Base").toString())) { + throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "删除失败,已存在福利核算记录")); + } + }); + + //删除自定义福利项 + categoryPO.setUpdateTime(new Date()); + getICategoryMapper().deleteCustomCategoryById(categoryPO); + return null; + } + private ICategoryDTO convertICategoryPO2DTO(ICategoryPO iCategoryPO){ return ICategoryDTO.builder().id(iCategoryPO.getId()).insuranceName(iCategoryPO.getInsuranceName()) .welfareType(iCategoryPO.getWelfareType()) diff --git a/src/com/engine/salary/web/SICategoryController.java b/src/com/engine/salary/web/SICategoryController.java index 19d92c792..4de4b1d1b 100644 --- a/src/com/engine/salary/web/SICategoryController.java +++ b/src/com/engine/salary/web/SICategoryController.java @@ -127,20 +127,15 @@ public class SICategoryController { /** - * 该接口暂时没用,删除福利类型对档案和台账核算都有很大的影响,暂时还没考虑好怎么做 - * 删除福利类型 - * - * @param request - * @param response - * @return + * 删除自定义福利项 + * 必要条件1-福利项未启用,2-福利核算数据中不能存在该福利项的核算数据 */ @POST @Path("/deleteCustomCategory") @Produces(MediaType.APPLICATION_JSON) - public String deleteSoftById(@Context HttpServletRequest request, @Context HttpServletResponse response) { + public String deleteCustomCategory(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ICategoryFormDTO iCategoryFormDTO) { User user = HrmUserVarify.getUser(request, response); - return null; - //return ResponseResult.run(getService(user)::delete, map); + return new ResponseResult< ICategoryFormDTO, Map>(user).run(getService(user)::deleteCustomCategory, iCategoryFormDTO); } From 74bb6e85c4a1676be8b07827a7d81658ee3a386e Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 26 Jul 2023 14:04:42 +0800 Subject: [PATCH 6/9] =?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=96=B9=E6=A1=88=EF=BC=8C=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=A6=8F=E5=88=A9=E9=A1=B9=E5=88=A0=E9=99=A4=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salary/service/impl/SICategoryServiceImpl.java | 10 +++++++--- src/com/engine/salary/web/SICategoryController.java | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/com/engine/salary/service/impl/SICategoryServiceImpl.java b/src/com/engine/salary/service/impl/SICategoryServiceImpl.java index 53f8b8d58..5b244ad01 100644 --- a/src/com/engine/salary/service/impl/SICategoryServiceImpl.java +++ b/src/com/engine/salary/service/impl/SICategoryServiceImpl.java @@ -6,6 +6,7 @@ import com.engine.salary.cmd.sicategory.SICategoryGetFormCmd; import com.engine.salary.cmd.sicategory.SICategoryInsertCmd; import com.engine.salary.cmd.sicategory.SICategoryUpdateCmd; import com.engine.salary.cmd.sicategory.SICategoryUpdateStatusByIdCmd; +import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; import com.engine.salary.entity.sicategory.dto.ICategoryDTO; import com.engine.salary.entity.sicategory.dto.ICategoryFormDTO; @@ -54,6 +55,8 @@ public class SICategoryServiceImpl extends Service implements SICategoryService return ServiceUtil.getService(RecordsBuildServiceImpl.class, user); } + private EncryptUtil encryptUtil = new EncryptUtil(); + @Override public Map getForm(Map params) { return commandExecutor.execute(new SICategoryGetFormCmd(params,user)); @@ -187,6 +190,7 @@ public class SICategoryServiceImpl extends Service implements SICategoryService // 判断自定义福利项是否存在核算数据 //获取所有福利核算数据 List insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().listAll(); + encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class); //数据组装 List> records = getRecordsBuildService(user).buildCommonRecords(insuranceAccountDetailPOS, null); String welfareTypeName = ""; @@ -206,9 +210,9 @@ public class SICategoryServiceImpl extends Service implements SICategoryService String welfareNameStart = categoryPO.getId() + welfareTypeName; //校验福利项是否存在核算记录 records.forEach(f -> { - if (StringUtils.isNotBlank(f.get(welfareNameStart + "Per").toString()) - || StringUtils.isNotBlank(f.get(welfareNameStart + "Com").toString()) - || StringUtils.isNotBlank(f.get(welfareNameStart + "Base").toString())) { + if (!Objects.isNull(f.get(welfareNameStart + "Per")) + || !Objects.isNull(f.get(welfareNameStart + "Com")) + || !Objects.isNull(f.get(welfareNameStart + "Base"))) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "删除失败,已存在福利核算记录")); } }); diff --git a/src/com/engine/salary/web/SICategoryController.java b/src/com/engine/salary/web/SICategoryController.java index 4de4b1d1b..0cbb6216b 100644 --- a/src/com/engine/salary/web/SICategoryController.java +++ b/src/com/engine/salary/web/SICategoryController.java @@ -128,8 +128,11 @@ public class SICategoryController { /** * 删除自定义福利项 - * 必要条件1-福利项未启用,2-福利核算数据中不能存在该福利项的核算数据 + * 必要条件: + * 1-福利项未启用, + * 2-福利核算数据中不能存在该福利项的核算数据 */ + @POST @Path("/deleteCustomCategory") @Produces(MediaType.APPLICATION_JSON) From 4b66380c5b594df76ae221daa7709c6279ca9cb6 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 31 Jul 2023 10:16:41 +0800 Subject: [PATCH 7/9] =?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=96=B9=E6=A1=88=EF=BC=8C=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=A6=8F=E5=88=A9=E9=A1=B9=E7=BC=96=E8=BE=91=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E4=BC=98=E5=8C=96=E5=90=8C=E5=90=8D=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=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/service/impl/SICategoryServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/engine/salary/service/impl/SICategoryServiceImpl.java b/src/com/engine/salary/service/impl/SICategoryServiceImpl.java index 5b244ad01..5cf300cf5 100644 --- a/src/com/engine/salary/service/impl/SICategoryServiceImpl.java +++ b/src/com/engine/salary/service/impl/SICategoryServiceImpl.java @@ -165,6 +165,7 @@ public class SICategoryServiceImpl extends Service implements SICategoryService } // 判断福利名称是否重复 List iCategoryPOS = getICategoryMapper().listByName(iCategoryFormDTO.getInsuranceName()); + iCategoryPOS = iCategoryPOS.stream().filter(f -> !f.getId().equals(iCategoryFormDTO.getId())).collect(Collectors.toList()); if(CollectionUtils.isNotEmpty(iCategoryPOS)){ throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "福利名称不能重复")); } From c0822d7822446e7b8aa92c485088b5d98dbb2052 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 31 Jul 2023 10:57:34 +0800 Subject: [PATCH 8/9] =?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=96=B9=E6=A1=88=EF=BC=8C=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=A6=8F=E5=88=A9=E9=A1=B9=E5=88=A0=E9=99=A4=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E8=8E=B7=E5=8F=96=E5=85=A8=E9=87=8F=E6=A0=B8?= =?UTF-8?q?=E7=AE=97=E6=98=8E=E7=BB=86=E6=97=B6=EF=BC=8C=E5=AF=B9=E4=BA=BA?= =?UTF-8?q?=E5=91=98id=E8=BF=9B=E8=A1=8C=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java index 86543188a..138eb8cf1 100644 --- a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java @@ -66,7 +66,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ if (CollectionUtils.isEmpty(list)) { return result; } - List employeeIds = list.stream().map(item -> item.getEmployeeId()).collect(Collectors.toList()); + List employeeIds = list.stream().map(item -> item.getEmployeeId()).distinct().collect(Collectors.toList()); List employeeByIds = new ArrayList<>(); List> partition = Lists.partition(employeeIds, 1000); for (List longs : partition) { From 293297ad7ff6c190b15af28f9dc9208dba559d7b Mon Sep 17 00:00:00 2001 From: sy Date: Tue, 1 Aug 2023 15:37:32 +0800 Subject: [PATCH 9/9] =?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=BA=BF=E4=B8=8B?= =?UTF-8?q?=E5=AF=B9=E6=AF=94=E5=AF=BC=E5=85=A5=E5=88=86=E6=89=B9,?= =?UTF-8?q?=E5=88=97=E8=A1=A8=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 --- .../entity/siaccount/bo/InsuranceComparisonResultBO.java | 4 ++-- src/com/engine/salary/service/impl/SIAccountServiceImpl.java | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java index c24a2f513..e8ffcf358 100644 --- a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java +++ b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java @@ -129,7 +129,7 @@ public class InsuranceComparisonResultBO { */ public static List> buildComparisonTableData(List accountExportPOS, List excelAccountExportPOS, Map schemeIdNameMap) { - Map> excelResultMap = SalaryEntityUtil.group2Map(excelAccountExportPOS, ExcelAccountExportPO::getWorkcode); + Map> excelResultMap = SalaryEntityUtil.group2Map(excelAccountExportPOS, ExcelAccountExportPO::getEmployeeId); // Map> acctResultMap = SalaryEntityUtil.group2Map(accountExportPOS, AccountExportPO::getWorkcode); List paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); @@ -172,7 +172,7 @@ public class InsuranceComparisonResultBO { map.put("otherSchemeName", schemeIdNameMap.get(accountExportPO.getOtherSchemeId())); //线下值 - List excelResultValueList = excelResultMap.get(accountExportPO.getWorkcode()); + List excelResultValueList = excelResultMap.get(accountExportPO.getEmployeeId()); ExcelAccountExportPO excelAccountExportPO = new ExcelAccountExportPO(); if (excelResultValueList != null && excelResultValueList.size() == 1) { excelAccountExportPO = excelResultValueList.get(0); diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 97093a2ec..15ced811c 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -2381,7 +2381,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { getExcelInsuranceDetailMapper().batchDelByIds(idList); } //新增 - getExcelInsuranceDetailMapper().batchSave(addCompareList); + List> partition = Lists.partition((List) addCompareList, 20); + partition.forEach(getExcelInsuranceDetailMapper()::batchSave); + +// getExcelInsuranceDetailMapper().batchSave(addCompareList); apidatas.put("successCount", successCount); apidatas.put("errorCount", failCount);