From 451c9fb07bc45cc2e026c1fafde520251b598c68 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 6 Dec 2023 09:51:07 +0800 Subject: [PATCH 01/12] =?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=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91=E6=94=B9?= =?UTF-8?q?=E9=80=A0=EF=BC=8C=E6=A0=B9=E6=8D=AE=E5=BA=94=E7=94=A8=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B8=AD=E7=9A=84=E5=8C=BA=E5=88=86=E5=BC=80=E5=85=B3?= =?UTF-8?q?=EF=BC=8C=E5=88=A4=E5=AE=9A=E5=90=8E=E5=B0=86=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E7=9A=84=E7=A6=8F=E5=88=A9=E5=9F=BA=E6=95=B0=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E5=8C=BA=E5=88=86=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 68 ++++++++++++++++--- .../po/InsuranceAccountDetailPO.java | 18 +++++ .../dto/InsuranceArchivesFundSchemeDTO.java | 2 + .../dto/InsuranceArchivesOtherSchemeDTO.java | 2 + .../dto/InsuranceArchivesSocialSchemeDTO.java | 3 + .../po/InsuranceArchivesFundSchemePO.java | 7 ++ .../po/InsuranceArchivesOtherSchemePO.java | 6 ++ .../po/InsuranceArchivesSocialSchemePO.java | 6 ++ .../sys/constant/SalarySysConstant.java | 5 ++ .../impl/SalarySysConfServiceImpl.java | 12 ++++ 10 files changed, 119 insertions(+), 10 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 528849995..e0ebc3bef 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -14,7 +14,6 @@ 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; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.siarchives.bo.InsuranceArchivesBO; @@ -37,6 +36,10 @@ import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; +import com.engine.salary.sys.entity.po.SalarySysConfPO; +import com.engine.salary.sys.enums.OpenEnum; +import com.engine.salary.sys.service.SalarySysConfService; +import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryFormItemUtil; @@ -65,6 +68,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.engine.salary.sys.constant.SalarySysConstant.WEL_BASE_DIFF_BY_PER_AND_COM; + /** * @Author weaver_cl @@ -113,6 +118,10 @@ public class SIArchivesBiz { return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private SalarySysConfService getSalarySysConfService(User user) { + return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); + } + /** * @param welfareType * @param employeeId @@ -266,15 +275,18 @@ public class SIArchivesBiz { */ public Map getPaymentForm(User user, WelfareTypeEnum welfareType, Long employeeId, long operateId, Long schemeId, Long paymentOrganization) { Map data = new HashMap<>(16); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); switch (welfareType) { case SOCIAL_SECURITY: - data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildSocialPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign); break; case ACCUMULATION_FUND: - data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildFundPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign); break; case OTHER: - data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization); + data = buildOtherPaymentForm(user, employeeId, schemeId, operateId, welfareType.getValue(), paymentOrganization, welBaseDiffSign); break; default: } @@ -289,12 +301,16 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildOtherPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) { Map dataMap = new HashMap<>(); InsuranceArchivesOtherSchemeDTO data = buildOtherForm(employeeId, operateId, paymentOrganization); if (data != null) { dataMap.put("data", JSONObject.parseObject(data.getOtherPaymentBaseString(), new TypeReference>() { })); + if (welBaseDiffSign) { + dataMap.put("comData", JSONObject.parseObject(data.getOtherPaymentComBaseString(), new TypeReference>() { + })); + } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); @@ -311,13 +327,17 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildFundPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) { Map dataMap = new HashMap<>(); InsuranceArchivesFundSchemeDTO data = buildFundForm(employeeId, operateId, paymentOrganization); if (data != null) { dataMap.put("data", JSONObject.parseObject(data.getFundPaymentBaseString(), new TypeReference>() { })); + if (welBaseDiffSign) { + dataMap.put("comData", JSONObject.parseObject(data.getFundPaymentComBaseString(), new TypeReference>() { + })); + } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); @@ -334,18 +354,28 @@ public class SIArchivesBiz { * @param operateId * @return */ - public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization) { + public Map buildSocialPaymentForm(User user, Long employeeId, Long schemeId, long operateId, Integer welfareType, Long paymentOrganization, boolean welBaseDiffSign) { Map dataMap = new HashMap<>(); InsuranceArchivesSocialSchemeDTO data = buildSocialForm(employeeId, operateId, paymentOrganization); if (data != null) { dataMap.put("data", JSONObject.parseObject(data.getSchemePaymentBaseString(), new TypeReference>() { })); + if (welBaseDiffSign) { + dataMap.put("comData", JSONObject.parseObject(data.getSchemePaymentComBaseString(), new TypeReference>() { + })); + } } List addGroups = new ArrayList<>(); List inputItems = buildPaymentBase(user, schemeId, welfareType); addGroups.add(new SearchConditionGroup("社保缴纳基数", true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("社保缴纳基数", true, inputComItems)); + dataMap.put("comItems", addComGroups); + } return dataMap; } @@ -361,9 +391,27 @@ public class SIArchivesBiz { if (schemeId == null) { return new ArrayList<>(); } - List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream().collect(Collectors.collectingAndThen( - Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InsuranceSchemeDetailPO::getInsuranceId))), ArrayList::new) - ); + List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue())).collect(Collectors.toList()); + SICategoryBiz siCategoryBiz = new SICategoryBiz(); + list.forEach(insuranceSchemeDetail -> { + ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId()); + if (iCategoryPO != null) { +// inputItems.add(SalaryFormItemUtil.inputNumberItem(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()))); + inputItems.add(SalaryFormItemUtil.inputNumberItemWithMaxAndMin(user, "precision:2", 2, 12, 2, iCategoryPO.getInsuranceName(), String.valueOf(insuranceSchemeDetail.getInsuranceId()) + , insuranceSchemeDetail.getUpperLimit(), insuranceSchemeDetail.getLowerLimit())); + } + }); + return inputItems; + } + + public List buildPaymentComBase(User user, Long schemeId, Integer welfareType) { + List inputItems = new ArrayList<>(); + if (schemeId == null) { + return new ArrayList<>(); + } + List list = queryListByPrimaryIdIsPayment(schemeId, welfareType).stream() + .filter(f -> f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue())).collect(Collectors.toList()); SICategoryBiz siCategoryBiz = new SICategoryBiz(); list.forEach(insuranceSchemeDetail -> { ICategoryPO iCategoryPO = siCategoryBiz.getByID(insuranceSchemeDetail.getInsuranceId()); diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java index e8f7ce98f..9cd2ad7f0 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailPO.java @@ -106,6 +106,12 @@ public class InsuranceAccountDetailPO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 公积金方案ID */ @@ -117,6 +123,12 @@ public class InsuranceAccountDetailPO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 其他福利方案id */ @@ -128,6 +140,12 @@ public class InsuranceAccountDetailPO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 社保个人缴费明细 */ diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java index f85206c01..4fcfdbcd1 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesFundSchemeDTO.java @@ -65,4 +65,6 @@ public class InsuranceArchivesFundSchemeDTO { //缴纳基数 private String fundPaymentBaseString; + + private String fundPaymentComBaseString; } diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java index a3c55fee5..3fa89c1c2 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesOtherSchemeDTO.java @@ -56,5 +56,7 @@ public class InsuranceArchivesOtherSchemeDTO { private String otherPaymentBaseString; + private String otherPaymentComBaseString; + //private WeaForm otherPaymentBase; } diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java index 1be1afbca..d4fc1dae8 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesSocialSchemeDTO.java @@ -59,4 +59,7 @@ public class InsuranceArchivesSocialSchemeDTO { //社保缴纳基数 private String schemePaymentBaseString; + //社保缴纳基数——单位 + private String schemePaymentComBaseString; + } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java index 7b333f4e6..fc171c94b 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesFundSchemePO.java @@ -87,6 +87,13 @@ public class InsuranceArchivesFundSchemePO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + + /** * 租户key */ diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java index 76146719d..9ad9d9668 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesOtherSchemePO.java @@ -77,6 +77,12 @@ public class InsuranceArchivesOtherSchemePO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 租户key */ diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java index e6f4ff038..645e5215b 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesSocialSchemePO.java @@ -83,6 +83,12 @@ public class InsuranceArchivesSocialSchemePO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 租户key */ diff --git a/src/com/engine/salary/sys/constant/SalarySysConstant.java b/src/com/engine/salary/sys/constant/SalarySysConstant.java index c5b6b08db..df5ea5ea2 100644 --- a/src/com/engine/salary/sys/constant/SalarySysConstant.java +++ b/src/com/engine/salary/sys/constant/SalarySysConstant.java @@ -105,4 +105,9 @@ public class SalarySysConstant { * 核算固定列头数 */ public static final String SALARY_ACCT_FIXED_COLUMNS = "salaryAcctFixedColumns"; + + /** + * 应用设置是否福利档案基数区分个人和单位 + */ + public static final String WEL_BASE_DIFF_BY_PER_AND_COM = "welBaseDiffByPerAndCom"; } diff --git a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java index 57fb34878..74ead2a26 100644 --- a/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java +++ b/src/com/engine/salary/sys/service/impl/SalarySysConfServiceImpl.java @@ -755,8 +755,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe insuranceArchivesSocialSchemePos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo)); + po.setSocialPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentComBaseString(), sysConfPo)); } else { po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString())); + po.setSocialPaymentComBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentComBaseString())); } }); List> partition = Lists.partition(insuranceArchivesSocialSchemePos, 50); @@ -782,8 +784,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe insuranceArchivesFundSchemePos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo)); + po.setFundPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentComBaseString(), sysConfPo)); } else { po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString())); + po.setFundPaymentComBaseString(AESEncryptUtil.encrypt(po.getFundPaymentComBaseString())); } }); List> partition = Lists.partition(insuranceArchivesFundSchemePos, 50); @@ -809,8 +813,10 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe insuranceArchivesOtherSchemePos.forEach(po -> { if (OpenEnum.OFF.getValue().equals(isOpenEncrypt)) { po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo)); + po.setOtherPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentComBaseString(), sysConfPo)); } else { po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString())); + po.setOtherPaymentComBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentComBaseString())); } }); List> partition = Lists.partition(insuranceArchivesOtherSchemePos, 50); @@ -869,6 +875,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe po.setSocialPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentBaseString(), sysConfPo)); po.setFundPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentBaseString(), sysConfPo)); po.setOtherPaymentBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentBaseString(), sysConfPo)); + po.setSocialPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getSocialPaymentComBaseString(), sysConfPo)); + po.setFundPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getFundPaymentComBaseString(), sysConfPo)); + po.setOtherPaymentComBaseString(AESEncryptUtil.closeEncryptSetting(po.getOtherPaymentComBaseString(), sysConfPo)); po.setSocialPerJson(AESEncryptUtil.closeEncryptSetting(po.getSocialPerJson(), sysConfPo)); po.setSocialPerSum(AESEncryptUtil.closeEncryptSetting(po.getSocialPerSum(), sysConfPo)); po.setFundPerJson(AESEncryptUtil.closeEncryptSetting(po.getFundPerJson(), sysConfPo)); @@ -887,6 +896,9 @@ public class SalarySysConfServiceImpl extends Service implements SalarySysConfSe po.setSocialPaymentBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentBaseString())); po.setFundPaymentBaseString(AESEncryptUtil.encrypt(po.getFundPaymentBaseString())); po.setOtherPaymentBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentBaseString())); + po.setSocialPaymentComBaseString(AESEncryptUtil.encrypt(po.getSocialPaymentComBaseString())); + po.setFundPaymentComBaseString(AESEncryptUtil.encrypt(po.getFundPaymentComBaseString())); + po.setOtherPaymentComBaseString(AESEncryptUtil.encrypt(po.getOtherPaymentComBaseString())); po.setSocialPerJson(AESEncryptUtil.encrypt(po.getSocialPerJson())); po.setSocialPerSum(AESEncryptUtil.encrypt(po.getSocialPerSum())); po.setFundPerJson(AESEncryptUtil.encrypt(po.getFundPerJson())); From ec8cb6214ddb4b6f4a758b9f71c5750ab1bdabe8 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 6 Dec 2023 14:04:12 +0800 Subject: [PATCH 02/12] =?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=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E7=BC=96=E8=BE=91=E4=BF=9D=E5=AD=98=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=94=B9=E9=80=A0=EF=BC=8C=E9=80=82=E9=85=8D=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=A1=A3=E6=A1=88=E7=A6=8F=E5=88=A9=E5=9F=BA=E6=95=B0?= =?UTF-8?q?=E6=8B=86=E5=88=86=E4=B8=AA=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 163 ++++++++++++++++-- .../dto/InsuranceArchivesBaseHistoryDTO.java | 6 + .../param/InsuranceArchivesSaveParam.java | 2 + .../po/InsuranceArchivesBaseHistoryPO.java | 2 + .../mapper/siarchives/FundSchemeMapper.xml | 5 + .../mapper/siarchives/OtherSchemeMapper.xml | 9 +- .../mapper/siarchives/SocialSchemeMapper.xml | 5 + .../service/impl/SIArchivesServiceImpl.java | 2 +- .../service/impl/SISchemeServiceImpl.java | 6 +- 9 files changed, 175 insertions(+), 25 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index e0ebc3bef..a58021031 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -669,17 +669,20 @@ public class SIArchivesBiz { * @param param * @param employeeId */ - public void insert(InsuranceArchivesSaveParam param, long employeeId) { + public void insert(InsuranceArchivesSaveParam param, User user) { SalaryAssert.notNull(param.getWelfareType(), "福利类型为空"); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); switch (param.getWelfareType()) { case SOCIAL_SECURITY: - socialSave(param, employeeId); + socialSave(param, user, welBaseDiffSign); break; case ACCUMULATION_FUND: - fundSave(param, employeeId); + fundSave(param, user, welBaseDiffSign); break; case OTHER: - otherSave(param, employeeId); + otherSave(param, user, welBaseDiffSign); break; default: throw new SalaryRunTimeException("福利类型不存在"); @@ -691,7 +694,8 @@ public class SIArchivesBiz { * @param paramReq * @param employeeId */ - public void otherSave(InsuranceArchivesSaveParam paramReq, long employeeId) { + public void otherSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { OtherSchemeMapper otherSchemeMapper = sqlSession.getMapper(OtherSchemeMapper.class); @@ -714,6 +718,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getOtherSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -725,6 +730,7 @@ public class SIArchivesBiz { encryptUtil.decrypt(oldOtherInfo, InsuranceArchivesOtherSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldOtherInfo.getOtherPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldOtherInfo.getOtherSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldOtherInfo.getOtherPaymentComBaseString()); //新数据 InsuranceArchivesOtherSchemePO updateOtherInfo = InsuranceArchivesOtherSchemePO.builder() @@ -744,9 +750,17 @@ public class SIArchivesBiz { .otherPaymentBaseString(paramReq.getPaymentForm()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString())) { + if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(updateOtherInfo, InsuranceArchivesOtherSchemePO.class); otherSchemeMapper.updateById(updateOtherInfo); //更新base_info表状态 @@ -780,9 +794,17 @@ public class SIArchivesBiz { .otherPaymentBaseString(paramReq.getPaymentForm()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString())) { + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertOtherInfo.setOtherPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(insertOtherInfo, InsuranceArchivesOtherSchemePO.class); otherSchemeMapper.insert(insertOtherInfo); sqlSession.commit(); @@ -818,7 +840,8 @@ public class SIArchivesBiz { * @param paramReq * @param employeeId */ - public void fundSave(InsuranceArchivesSaveParam paramReq, long employeeId) { + public void fundSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { FundSchemeMapper fundSchemeMapper = sqlSession.getMapper(FundSchemeMapper.class); @@ -840,6 +863,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getFundSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -851,6 +875,7 @@ public class SIArchivesBiz { encryptUtil.decrypt(oldFundInfo, InsuranceArchivesFundSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldFundInfo.getFundPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldFundInfo.getFundSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldFundInfo.getFundPaymentComBaseString()); //新数据 InsuranceArchivesFundSchemePO updateFundInfo = InsuranceArchivesFundSchemePO.builder() .id(oldFundInfo.getId()) @@ -871,9 +896,17 @@ public class SIArchivesBiz { .employeeId(param.getEmployeeId()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString())) { + if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(updateFundInfo, InsuranceArchivesFundSchemePO.class); fundSchemeMapper.updateById(updateFundInfo); //更新base_info表状态 @@ -909,9 +942,17 @@ public class SIArchivesBiz { .employeeId(param.getEmployeeId()) .build(); //校验福利基数是否符合上下限要求, - if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString())) { + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertFundInfo.setFundPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(insertFundInfo, InsuranceArchivesFundSchemePO.class); fundSchemeMapper.insert(insertFundInfo); sqlSession.commit(); @@ -949,8 +990,8 @@ public class SIArchivesBiz { * @param paramReq * @param employeeId */ - public void socialSave(InsuranceArchivesSaveParam paramReq, long employeeId) { - + public void socialSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { + long employeeId = user.getUID(); SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { SocialSchemeMapper socialSchemeMapper = sqlSession.getMapper(SocialSchemeMapper.class); @@ -977,6 +1018,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(param.getSocialSchemeId()) .adjustAfterBaseJson(paramReq.getPaymentForm()) + .adjustAfterComBaseJson(paramReq.getPaymentComForm()) .welfareType(paramReq.getWelfareType().getValue()) .employeeId(param.getEmployeeId()) .paymentOrganization(param.getPaymentOrganization()) @@ -990,6 +1032,7 @@ public class SIArchivesBiz { encryptUtil.decrypt(oldSocialInfo, InsuranceArchivesSocialSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldSocialInfo.getSocialPaymentBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldSocialInfo.getSocialSchemeId()); + adjustInfo.setAdjustBeforeComBaseJson(oldSocialInfo.getSocialPaymentComBaseString()); //新数据 InsuranceArchivesSocialSchemePO updateSocialInfo = InsuranceArchivesSocialSchemePO.builder() @@ -1010,9 +1053,17 @@ public class SIArchivesBiz { .paymentOrganization(param.getPaymentOrganization()) .build(); //校验福利基数是否符合上下限要求 - if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString())) { + if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + updateSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(updateSocialInfo, InsuranceArchivesSocialSchemePO.class); socialSchemeMapper.updateById(updateSocialInfo); //更新base_info表状态 @@ -1048,9 +1099,17 @@ public class SIArchivesBiz { .paymentOrganization(param.getPaymentOrganization()) .build(); //校验福利基数是否符合上下限要求 - if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString())) { + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue())) { throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); } + //需要拆分个人和公司福利基数时 + if (welBaseDiffSign) { + insertSocialInfo.setSocialPaymentComBaseString(paramReq.getPaymentComForm()); + //校验福利基数是否符合上下限要求 + if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue())) { + throw new SalaryRunTimeException("社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"); + } + } encryptUtil.encrypt(insertSocialInfo, InsuranceArchivesSocialSchemePO.class); socialSchemeMapper.insert(insertSocialInfo); sqlSession.commit(); @@ -1088,14 +1147,11 @@ public class SIArchivesBiz { * @param paymentBaseString * @return */ - public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString) { + public Boolean checkWelBaseLimit(Long primaryId, String paymentBaseString, Integer paymentScope) { if (primaryId ==null || paymentBaseString == null) { return true; } - //设置缴纳对象和缴费状态 -// Integer paymentScope = 2; -// Integer isPayment = 1; Map paymentBaseJson = JSON.parseObject(paymentBaseString, new HashMap().getClass()); if (paymentBaseJson == null) { return true; @@ -1119,7 +1175,7 @@ public class SIArchivesBiz { return false; } List isPaymentList = insuranceSchemeDetailPOList.stream() - .filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue())).collect(Collectors.toList()); + .filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)).collect(Collectors.toList()); if (isPaymentList.size() > 0) { InsuranceSchemeDetailPO insuranceSchemeDetailPO = isPaymentList.get(0); @@ -2035,6 +2091,11 @@ public class SIArchivesBiz { //生成基数调整记录(基数单元未变化则忽略) public List createAdjustInfo(InsuranceArchivesBaseHistoryDTO adjustInfo, Long creator) { Date now = new Date(); + //判断是否要区分个人和单位福利基数 + User user = new User(Math.toIntExact(creator)); + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + List toCreateAdjustHistoryList = new ArrayList<>(); //旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。 if(StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isBlank(adjustInfo.getAdjustBeforeBaseJson())) { @@ -2053,6 +2114,7 @@ public class SIArchivesBiz { adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(welBaseDiffSign ? PaymentScopeEnum.SCOPE_PERSON.getValue().toString() : PaymentScopeEnum.SCOPE_PERSON.getValue().toString() + "," + PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); toCreateAdjustHistoryList.add(adjustItem); } } else if (StringUtils.isNotBlank(adjustInfo.getAdjustAfterBaseJson()) && StringUtils.isNotBlank(adjustInfo.getAdjustBeforeBaseJson())) { @@ -2087,12 +2149,75 @@ public class SIArchivesBiz { adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(welBaseDiffSign ? PaymentScopeEnum.SCOPE_PERSON.getValue().toString() : PaymentScopeEnum.SCOPE_PERSON.getValue().toString() + "," + PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); toCreateAdjustHistoryList.add(adjustItem); } } } + //如果系统应用设置拆分了个人和公司福利基数,则对adjustBeforeComBaseJson,adjustAfterComBaseJson也进行处理 + if (welBaseDiffSign) { + //旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。 + if(StringUtils.isNotBlank(adjustInfo.getAdjustAfterComBaseJson()) && StringUtils.isBlank(adjustInfo.getAdjustBeforeComBaseJson())) { + Map adjustAfterComBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterComBaseJson(), new TypeReference>() { + }); + for (String key : adjustAfterComBaseMap.keySet()) { + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustAfterBaseValue((String) adjustAfterComBaseMap.get(key)); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope(PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + toCreateAdjustHistoryList.add(adjustItem); + } + } else if (StringUtils.isNotBlank(adjustInfo.getAdjustAfterComBaseJson()) && StringUtils.isNotBlank(adjustInfo.getAdjustBeforeComBaseJson())) { + Map adjustAfterComBaseMap = JSON.parseObject(adjustInfo.getAdjustAfterComBaseJson(), new TypeReference>() { + }); + Map adjustBeforeComBaseMap = JSON.parseObject(adjustInfo.getAdjustBeforeComBaseJson(), new TypeReference>() { + }); + Map reDealMap = new HashMap<>(); + if (adjustAfterComBaseMap != null) { + reDealMap.putAll(adjustAfterComBaseMap); + } + if (adjustBeforeComBaseMap != null) { + reDealMap.putAll(adjustBeforeComBaseMap); + } + if (reDealMap.size() >0) { + for (String key : reDealMap.keySet()) { + String beforeValue = (String) adjustBeforeComBaseMap.get(key); + String afterValue = (String) adjustAfterComBaseMap.get(key); + if (SalaryEntityUtil.empty2Zero(beforeValue).compareTo(SalaryEntityUtil.empty2Zero(afterValue)) == 0) { + continue; + } + InsuranceArchivesBaseHistoryPO adjustItem = new InsuranceArchivesBaseHistoryPO(); + BeanUtils.copyProperties(adjustInfo, adjustItem); + adjustItem.setAdjustWelfareItemId(Long.valueOf(key)); + adjustItem.setAdjustBeforeBaseValue(beforeValue); + adjustItem.setAdjustAfterBaseValue(afterValue); + adjustItem.setOperateTime(now); + adjustItem.setOperator(creator); + adjustItem.setCreator(creator); + adjustItem.setCreateTime(now); + adjustItem.setUpdateTime(now); + adjustItem.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue()); + adjustItem.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY); + adjustItem.setId(IdGenerator.generate()); + adjustItem.setPaymentScope( PaymentScopeEnum.SCOPE_COMPANY.getValue().toString()); + + toCreateAdjustHistoryList.add(adjustItem); + } + } + + } + } return toCreateAdjustHistoryList; } diff --git a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java index 259cc3e54..a0c2d57e8 100644 --- a/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java +++ b/src/com/engine/salary/entity/siarchives/dto/InsuranceArchivesBaseHistoryDTO.java @@ -70,12 +70,18 @@ public class InsuranceArchivesBaseHistoryDTO { private String adjustAfterBaseJson; + private String adjustBeforeComBaseJson; + + private String adjustAfterComBaseJson; + @TableTitle(title = "对象", dataIndex = "employeeName", key = "employeeName") private String employeeName; @TableTitle(title = "个税扣缴义务人", dataIndex = "paymentOrganizationName", key = "paymentOrganizationName") private String paymentOrganizationName; @TableTitle(title = "福利项名称", dataIndex = "welfareItemName", key = "welfareItemName") private String welfareItemName; + @TableTitle(title = "缴费对象", dataIndex = "paymentScope", key = "paymentScope") + private String paymentScope; @TableTitle(title = "调整前方案", dataIndex = "adjustBeforeSchemeName", key = "adjustBeforeSchemeName") private String adjustBeforeSchemeName; @TableTitle(title = "调整前基数", dataIndex = "adjustBeforeBaseValue", key = "adjustBeforeBaseValue") diff --git a/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java b/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java index 7e4e46fb7..8d086b1ad 100644 --- a/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java +++ b/src/com/engine/salary/entity/siarchives/param/InsuranceArchivesSaveParam.java @@ -23,4 +23,6 @@ public class InsuranceArchivesSaveParam { private String baseForm; private String paymentForm; + + private String paymentComForm; } diff --git a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java index 6939c2258..52d31f804 100644 --- a/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java +++ b/src/com/engine/salary/entity/siarchives/po/InsuranceArchivesBaseHistoryPO.java @@ -77,4 +77,6 @@ public class InsuranceArchivesBaseHistoryPO { private Date createTime; private Date updateTime; + + private String paymentScope; } diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml index fc91b8885..56731a58b 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml @@ -14,6 +14,7 @@ + @@ -35,6 +36,7 @@ , t.payment_organization , t.under_take , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -311,6 +313,7 @@ welfare_type = #{welfareType}, fund_payment_base_string = #{fundPaymentBaseString}, + fund_payment_com_base_string = #{fundPaymentComBaseString}, fund_scheme_id = #{fundSchemeId}, fund_end_time = #{fundEndTime}, fund_start_time = #{fundStartTime}, @@ -353,6 +356,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -371,6 +375,7 @@ #{fundEndTime}, #{fundStartTime}, #{fundPaymentBaseString}, + #{fundPaymentComBaseString}, #{supplementFundAccount}, #{createTime}, #{creator}, diff --git a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml index d1a18db07..de0febe4f 100644 --- a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml @@ -12,6 +12,7 @@ + @@ -31,6 +32,7 @@ , t.payment_organization , t.under_take , t.other_payment_base_string + , t.other_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -292,6 +294,7 @@ welfare_type = #{welfareType}, other_payment_base_string = #{otherPaymentBaseString}, + other_payment_com_base_string = #{otherPaymentComBaseString}, other_scheme_id = #{otherSchemeId}, other_end_time = #{otherEndTime}, other_start_time = #{otherStartTime}, @@ -340,7 +343,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( #{otherSchemeId}, @@ -356,7 +360,8 @@ #{nonPayment}, #{creator}, #{paymentOrganization}, - #{otherPaymentBaseString} + #{otherPaymentBaseString}, + #{otherPaymentComBaseString} ) \ No newline at end of file diff --git a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml index 8472020a2..c27048d10 100644 --- a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml @@ -13,6 +13,7 @@ + @@ -33,6 +34,7 @@ , t.payment_organization , t.under_take , t.social_payment_base_string + , t.social_payment_com_base_string , t.create_time , t.update_time , t.creator @@ -955,6 +957,7 @@ welfare_type = #{welfareType}, social_payment_base_string = #{socialPaymentBaseString}, + social_payment_com_base_string = #{socialPaymentComBaseString}, social_scheme_id = #{socialSchemeId}, social_end_time = #{socialEndTime}, social_start_time = #{socialStartTime}, @@ -994,6 +997,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -1011,6 +1015,7 @@ #{welfareType}, #{deleteType}, #{socialPaymentBaseString}, + #{socialPaymentComBaseString}, #{socialSchemeId}, #{createTime}, #{socialEndTime}, diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index 59b4d8e48..11299554e 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -141,7 +141,7 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService @Override public String insert(InsuranceArchivesSaveParam param) { SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); - siArchivesBiz.insert(param, (long) user.getUID()); + siArchivesBiz.insert(param, user); return null; } diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 8746fdd48..d49f971e2 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -1102,11 +1102,11 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesAccountPO.setOther(insuranceArchivesOtherSchemePO); insuranceArchivesAccountPO.setBaseInfo(insuranceArchivesBaseInfoPO); //校验福利基数是否符合上下限要求, - Boolean socialCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString()); + Boolean socialCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); - Boolean fundCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString()); + Boolean fundCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); - Boolean otherCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString()); + Boolean otherCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); if (socialCheckBase && fundCheckBase && otherCheckBase) { insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO); From 6dca2a43800b08f8d4101f40ac6a2ff095f5e817 Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 6 Dec 2023 15:38:19 +0800 Subject: [PATCH 03/12] =?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=BC=80=E5=90=AF?= =?UTF-8?q?=E5=BC=80=E5=85=B3=E6=97=B6=EF=BC=8C=E6=A1=A3=E6=A1=88=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=B1=95=E7=A4=BA=EF=BC=8C=E5=8C=BA=E5=88=86=E4=B8=AA?= =?UTF-8?q?=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8=E7=A6=8F=E5=88=A9=E5=9F=BA?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 282 +++++++++++++++--- .../salary/web/SIArchivesController.java | 2 + 2 files changed, 241 insertions(+), 43 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index a58021031..eb4980815 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -13,6 +13,7 @@ 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.common.SalaryContext; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; @@ -1383,6 +1384,7 @@ public class SIArchivesBiz { * @return */ public List buildWeaTableColumns(List insuranceArchivesEmployeePOS, long operateId) { + Map> titleMap = buildColumnTitle(insuranceArchivesEmployeePOS, operateId); List list = new ArrayList<>(); WeaTableColumn nameColumn = new WeaTableColumn("100px", "姓名", "employeeName"); @@ -1422,6 +1424,9 @@ public class SIArchivesBiz { * @return */ public Map> buildColumnTitle(List insuranceArchivesEmployeePOS, long operateId) { + + boolean welBaseDiffSign = isDiffWelBase(); + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); Map> result = new HashMap<>(); @@ -1437,16 +1442,17 @@ public class SIArchivesBiz { Set fundSet = new HashSet<>(); Set otherSet = new HashSet<>(); + Set socialComSet = new HashSet<>(); + Set fundComSet = new HashSet<>(); + Set otherComSet = new HashSet<>(); + insuranceArchivesEmployeePOS.forEach(item -> { List socialList = socialSchemeMapper.getSocialByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(socialList, InsuranceArchivesSocialSchemePO.class); -// InsuranceArchivesSocialSchemePO socialItem = socialList.size() != 0 ? socialList.get(0) : null; List fundList = fundSchemeMapper.getFundByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(fundList, InsuranceArchivesFundSchemePO.class); -// InsuranceArchivesFundSchemePO fundItem = fundList.size() != 0 ? fundList.get(0) : null; List otherList = otherSchemeMapper.getOtherByEmployeeId(Collections.singletonList(item.getEmployeeId())); encryptUtil.decryptList(otherList, InsuranceArchivesOtherSchemePO.class); -// InsuranceArchivesOtherSchemePO otherItem = otherList.size() != 0 ? otherList.get(0) : null; if (socialList.size() > 0) { for (InsuranceArchivesSocialSchemePO socialSchemePO : socialList) { @@ -1455,6 +1461,14 @@ public class SIArchivesBiz { if (socialJson != null) { socialJson.forEach((k, v) -> socialSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(socialSchemePO.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socialComSet.add(k)); + } + } } } @@ -1465,6 +1479,14 @@ public class SIArchivesBiz { if (fundJson != null) { fundJson.forEach((k, v) -> fundSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(fundSchemePO.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComSet.add(k)); + } + } } } @@ -1475,11 +1497,20 @@ public class SIArchivesBiz { if (otherJson != null) { otherJson.forEach((k, v) -> otherSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(otherSchemePO.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComSet.add(k)); + } + } } } }); Map socialMap = new HashMap<>(); + Map socialComMap = new HashMap<>(); Map socialCollect = new HashMap<>(); Map customSocial = iCategoryMapper.listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null) .stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); @@ -1489,34 +1520,89 @@ public class SIArchivesBiz { socialCollect.putAll(customSocial); socialCollect.putAll(sysSocial); - socialSet.forEach(item -> { - if (socialCollect.containsKey(Long.valueOf(item))) { - socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); - } - }); +// socialSet.forEach(item -> { +// if (socialCollect.containsKey(Long.valueOf(item))) { +// socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); +// } +// }); + if (welBaseDiffSign) { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "个人"); + } + }); + socialComSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "单位"); + } + }); + } else { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); + } + }); + } Map fundMap = new HashMap<>(); + Map fundComMap = new HashMap<>(); Map fundCollect = new HashMap<>(); Map customFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); fundCollect.putAll(customFund); fundCollect.putAll(sysFund); - fundSet.forEach(item -> { - if (fundCollect.containsKey(Long.valueOf(item))) { - fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); - } - }); +// fundSet.forEach(item -> { +// if (fundCollect.containsKey(Long.valueOf(item))) { +// fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); +// } +// }); + if (welBaseDiffSign) { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "个人"); + } + }); + fundComSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "单位"); + } + }); + } else { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); + } + }); + } Map otherMap = new HashMap<>(); + Map otherComMap = new HashMap<>(); Map otherCollect = new HashMap<>(); Map customOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); otherCollect.putAll(customOther); otherCollect.putAll(sysOther); - otherSet.forEach(item -> { - if (otherCollect.containsKey(Long.valueOf(item))) { - otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); - } - }); - +// otherSet.forEach(item -> { +// if (otherCollect.containsKey(Long.valueOf(item))) { +// otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); +// } +// }); + if (welBaseDiffSign) { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "个人"); + } + }); + otherComSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "单位"); + } + }); + } else { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); + } + }); + } // map根据key排序 LinkedHashMap socialMapWithAscKey = socialMap.entrySet().stream() .sorted(Map.Entry.comparingByKey()) @@ -1530,6 +1616,23 @@ public class SIArchivesBiz { .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialMapWithAscKey.putAll(socialComMapWithAscKey); + fundMapWithAscKey.putAll(fundComMapWithAscKey); + otherMapWithAscKey.putAll(otherComMapWithAscKey); + } result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMapWithAscKey); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMapWithAscKey); @@ -1552,6 +1655,9 @@ public class SIArchivesBiz { * @return */ public List> buildTableData(List insuranceArchivesEmployeePOS, boolean export) { + + boolean welBaseDiffSign = isDiffWelBase(); + List taxAgentPOS = getTaxAgentMapper().listAll(); Map longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); @@ -1599,16 +1705,39 @@ public class SIArchivesBiz { map.put("socialName", insuranceSchemeMapper.querySchemeName(socialItem.getSocialSchemeId())); Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { }); - if (socialJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); - socialJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(socialJson); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("socialAccount", socialItem.getSocialAccount()); map.put("socialStartTime", socialItem.getSocialStartTime()); map.put("socialEndTime", socialItem.getSocialEndTime()); @@ -1618,16 +1747,39 @@ public class SIArchivesBiz { map.put("fundAccount", fundItem.getFundAccount()); Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { }); - if (fundJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); - fundJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(fundJson); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); map.put("fundStartTime", fundItem.getFundStartTime()); map.put("fundEndTime", fundItem.getFundEndTime()); @@ -1637,16 +1789,39 @@ public class SIArchivesBiz { map.put("otherName", insuranceSchemeMapper.querySchemeName(otherItem.getOtherSchemeId())); Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { }); - if (otherJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); - otherJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(otherJson); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } + map.put("otherStartTime", otherItem.getOtherStartTime()); map.put("otherEndTime", otherItem.getOtherEndTime()); } @@ -1669,6 +1844,19 @@ public class SIArchivesBiz { } return insuranceIdList; } + + public List payInsuranceIds(Long socialSchemeId, Integer paymentScope) { + //查询该福利方案下开启缴纳的福利项 + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialSchemeId); + List insuranceIdList = new ArrayList<>(); + if (detailPOS != null && detailPOS.size() > 0) { + //开启缴纳的 + insuranceIdList = detailPOS.stream().filter(f -> f.getIsPayment().equals(IsPaymentEnum.YES.getValue()) && f.getPaymentScope().equals(paymentScope)) + .map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); + } + return insuranceIdList; + } + /** * 获取信息提示 */ @@ -2296,4 +2484,12 @@ public class SIArchivesBiz { list.add(new WeaTableColumn("150px", "操作时间", "operatorTime")); return list; } + + public boolean isDiffWelBase() { + User user = (User) SalaryContext.get().getValue("user"); + //判断是否要区分个人和单位福利基数 + SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); + + return welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + } } diff --git a/src/com/engine/salary/web/SIArchivesController.java b/src/com/engine/salary/web/SIArchivesController.java index ecc61b1b5..e0b3bfe89 100644 --- a/src/com/engine/salary/web/SIArchivesController.java +++ b/src/com/engine/salary/web/SIArchivesController.java @@ -2,6 +2,7 @@ package com.engine.salary.web; import com.engine.common.util.ParamUtil; import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.SalaryContext; import com.engine.salary.entity.siarchives.dto.InsuranceArchivesBaseHistoryDTO; import com.engine.salary.entity.siarchives.param.InsuranceArchivesListParam; import com.engine.salary.entity.siarchives.param.InsuranceArchivesSaveParam; @@ -33,6 +34,7 @@ import java.util.Map; public class SIArchivesController { private SIArchivesService getService(User user) { + SalaryContext.get().setValue("user",user); return ServiceUtil.getService(SIArchivesServiceImpl.class,user); } From 1287a97fe5a6f8eaed47559b222067cf0c6f965b Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 7 Dec 2023 09:41:46 +0800 Subject: [PATCH 04/12] =?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=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E4=B8=8B=E8=BD=BD=E3=80=81=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E3=80=81=E5=9F=BA=E6=95=B0=E8=B0=83=E6=95=B4=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=A0=B9=E6=8D=AE=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E5=9F=BA=E6=95=B0=E9=80=BB=E8=BE=91=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 11 +- .../mapper/siarchives/FundSchemeMapper.xml | 6 + .../InsuranceBaseAdjustHistoryMapper.xml | 20 +- .../mapper/siarchives/OtherSchemeMapper.xml | 18 +- .../mapper/siarchives/SocialSchemeMapper.xml | 6 + .../service/impl/SIArchivesServiceImpl.java | 14 ++ .../service/impl/SIImportServiceImpl.java | 28 ++- .../service/impl/SISchemeServiceImpl.java | 187 ++++++++++++++---- 8 files changed, 234 insertions(+), 56 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index eb4980815..fbf526ca6 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -2198,6 +2198,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getSocialSchemeId()) .adjustAfterBaseJson(po.getSocialPaymentBaseString()) + .adjustAfterComBaseJson(po.getSocialPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -2207,6 +2208,7 @@ public class SIArchivesBiz { InsuranceArchivesSocialSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesSocialSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getSocialPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getSocialPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getSocialSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保档案存在冗余数据!")); @@ -2228,6 +2230,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getFundSchemeId()) .adjustAfterBaseJson(po.getFundPaymentBaseString()) + .adjustAfterComBaseJson(po.getFundPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -2237,6 +2240,7 @@ public class SIArchivesBiz { InsuranceArchivesFundSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesFundSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getFundPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getFundPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getFundSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金档案存在冗余数据!")); @@ -2257,6 +2261,7 @@ public class SIArchivesBiz { InsuranceArchivesBaseHistoryDTO adjustInfo = InsuranceArchivesBaseHistoryDTO.builder() .adjustAfterSchemeId(po.getOtherSchemeId()) .adjustAfterBaseJson(po.getOtherPaymentBaseString()) + .adjustAfterComBaseJson(po.getOtherPaymentComBaseString()) .welfareType(po.getWelfareType()) .employeeId(po.getEmployeeId()) .paymentOrganization(po.getPaymentOrganization()) @@ -2266,6 +2271,7 @@ public class SIArchivesBiz { InsuranceArchivesOtherSchemePO oldBaseInfo = oldBaseInfoList.get(0); encryptUtil.decrypt(oldBaseInfo, InsuranceArchivesOtherSchemePO.class); adjustInfo.setAdjustBeforeBaseJson(oldBaseInfo.getOtherPaymentBaseString()); + adjustInfo.setAdjustBeforeComBaseJson(oldBaseInfo.getOtherPaymentComBaseString()); adjustInfo.setAdjustBeforeSchemeId(oldBaseInfo.getOtherSchemeId()); } else if (oldBaseInfoList.size() > 1) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利档案存在冗余数据!")); @@ -2279,10 +2285,7 @@ public class SIArchivesBiz { //生成基数调整记录(基数单元未变化则忽略) public List createAdjustInfo(InsuranceArchivesBaseHistoryDTO adjustInfo, Long creator) { Date now = new Date(); - //判断是否要区分个人和单位福利基数 - User user = new User(Math.toIntExact(creator)); - SalarySysConfPO welBaseDiff = getSalarySysConfService(user).getOneByCode(WEL_BASE_DIFF_BY_PER_AND_COM); - boolean welBaseDiffSign = welBaseDiff != null && welBaseDiff.getConfValue().equals(OpenEnum.OPEN.getValue()); + boolean welBaseDiffSign = isDiffWelBase(); List toCreateAdjustHistoryList = new ArrayList<>(); //旧档案不存在基数信息,则直接遍历新的基数数据,生成调整记录;旧档案存在基数信息,则合并新旧基数数据,遍历合并后的技术数据中的key,生成调整记录。 diff --git a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml index 56731a58b..afdde68a1 100644 --- a/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/FundSchemeMapper.xml @@ -137,6 +137,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -156,6 +157,7 @@ #{item.fundEndTime}, #{item.fundStartTime}, #{item.fundPaymentBaseString}, + #{item.fundPaymentComBaseString}, #{item.supplementFundAccount}, #{item.createTime}, #{item.creator}, @@ -177,6 +179,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -195,6 +198,7 @@ #{item.fundEndTime,jdbcType=VARCHAR}, #{item.fundStartTime,jdbcType=VARCHAR}, #{item.fundPaymentBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, #{item.supplementFundAccount,jdbcType=VARCHAR}, #{item.createTime,jdbcType=DATE}, #{item.creator,jdbcType=DOUBLE}, @@ -217,6 +221,7 @@ fund_end_time, fund_start_time, fund_payment_base_string, + fund_payment_com_base_string, supplement_fund_account, create_time, creator, @@ -235,6 +240,7 @@ #{item.fundEndTime}, #{item.fundStartTime}, #{item.fundPaymentBaseString}, + #{item.fundPaymentComBaseString}, #{item.supplementFundAccount}, #{item.createTime}, #{item.creator}, diff --git a/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml b/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml index da02c83b5..0752177a1 100644 --- a/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/InsuranceBaseAdjustHistoryMapper.xml @@ -12,6 +12,7 @@ + @@ -33,6 +34,7 @@ , t.adjust_before_base_value , t.adjust_after_base_value , t.adjust_welfare_item_id + , t.payment_scope , t.operator , t.operate_time , t.create_time @@ -48,7 +50,7 @@ adjust_before_scheme_id,adjust_after_scheme_id, adjust_before_base_value,adjust_after_base_value, adjust_welfare_item_id,operator,operate_time, - tenant_key,creator,delete_type,create_time,update_time) + tenant_key,creator,delete_type,create_time,update_time,payment_scope) VALUES ( @@ -67,7 +69,8 @@ #{item.creator}, #{item.deleteType}, #{item.createTime}, - #{item.updateTime} + #{item.updateTime}, + #{item.paymentScope} ) @@ -77,7 +80,7 @@ adjust_before_scheme_id,adjust_after_scheme_id, adjust_before_base_value,adjust_after_base_value, adjust_welfare_item_id,operator,operate_time, - tenant_key,creator,delete_type,create_time,update_time) + tenant_key,creator,delete_type,create_time,update_time,payment_scope) select #{item.id,jdbcType=DOUBLE}, @@ -95,7 +98,8 @@ #{item.creator,jdbcType=DOUBLE}, #{item.deleteType}, #{item.createTime}, - #{item.updateTime} + #{item.updateTime}, + #{item.paymentScope} from dual @@ -106,7 +110,7 @@ adjust_before_scheme_id,adjust_after_scheme_id, adjust_before_base_value,adjust_after_base_value, adjust_welfare_item_id,operator,operate_time, - tenant_key,creator,delete_type,create_time,update_time) + tenant_key,creator,delete_type,create_time,update_time,payment_scope) VALUES ( #{item.id}, @@ -124,7 +128,8 @@ #{item.creator}, #{item.deleteType}, #{item.createTime}, - #{item.updateTime} + #{item.updateTime}, + #{item.paymentScope} ) @@ -148,6 +153,7 @@ , eo.lastname as operatorName , ee.lastname as employeeName , p.name as paymentOrganizationName + , t.payment_scope FROM hrsa_insurance_base_history t LEFT JOIN hrmresource eo on eo.id = t.operator LEFT JOIN hrmresource ee on ee.id = t.employee_id @@ -180,6 +186,7 @@ , eo.lastname as operatorName , ee.lastname as employeeName , p.name as paymentOrganizationName + , t.payment_scope FROM hrsa_insurance_base_history t LEFT JOIN hrmresource eo on eo.id = t.operator LEFT JOIN hrmresource ee on ee.id = t.employee_id @@ -216,6 +223,7 @@ , eo.lastname as operatorName , ee.username as employeeName , p.name as paymentOrganizationName + , t.payment_scope FROM hrsa_insurance_base_history t LEFT JOIN hrmresource eo on eo.id = t.operator LEFT JOIN hrsa_external_employee ee on ee.id = t.employee_id diff --git a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml index de0febe4f..2d67257b4 100644 --- a/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/OtherSchemeMapper.xml @@ -131,7 +131,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( @@ -148,7 +149,8 @@ #{item.nonPayment}, #{item.creator}, #{item.paymentOrganization}, - #{item.otherPaymentBaseString} + #{item.otherPaymentBaseString}, + #{item.otherPaymentComBaseString} ) @@ -167,7 +169,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) select #{item.otherSchemeId,jdbcType=DOUBLE}, @@ -183,7 +186,8 @@ #{item.nonPayment,jdbcType=INTEGER}, #{item.creator,jdbcType=DOUBLE}, #{item.paymentOrganization,jdbcType=DOUBLE}, - #{item.otherPaymentBaseString,jdbcType=VARCHAR} + #{item.otherPaymentBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -203,7 +207,8 @@ non_payment, creator, payment_organization, - other_payment_base_string) + other_payment_base_string, + other_payment_com_base_string) VALUES ( #{item.otherSchemeId}, @@ -219,7 +224,8 @@ #{item.nonPayment}, #{item.creator}, #{item.paymentOrganization}, - #{item.otherPaymentBaseString} + #{item.otherPaymentBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml index c27048d10..79562932f 100644 --- a/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml +++ b/src/com/engine/salary/mapper/siarchives/SocialSchemeMapper.xml @@ -130,6 +130,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -148,6 +149,7 @@ #{item.welfareType}, #{item.deleteType}, #{item.socialPaymentBaseString}, + #{item.socialPaymentComBaseString}, #{item.socialSchemeId}, #{item.createTime}, #{item.socialEndTime}, @@ -168,6 +170,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -185,6 +188,7 @@ #{item.welfareType,jdbcType=INTEGER}, #{item.deleteType,jdbcType=INTEGER}, #{item.socialPaymentBaseString,jdbcType=VARCHAR}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, #{item.socialSchemeId,jdbcType=DOUBLE}, #{item.createTime,jdbcType=DATE}, #{item.socialEndTime,jdbcType=VARCHAR}, @@ -206,6 +210,7 @@ welfare_type, delete_type, social_payment_base_string, + social_payment_com_base_string, social_scheme_id, create_time, social_end_time, @@ -223,6 +228,7 @@ #{item.welfareType}, #{item.deleteType}, #{item.socialPaymentBaseString}, + #{item.socialPaymentComBaseString}, #{item.socialSchemeId}, #{item.createTime}, #{item.socialEndTime}, diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index 11299554e..8738c66f9 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -20,6 +20,7 @@ import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum; import com.engine.salary.enums.siaccount.EmployeeStatusEnum; import com.engine.salary.enums.sicategory.DeleteTypeEnum; import com.engine.salary.enums.sicategory.NonPaymentEnum; +import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.enums.sicategory.WelfareTypeEnum; import com.engine.salary.enums.taxagent.TaxAgentEmpChangeModuleEnum; import com.engine.salary.exception.SalaryRunTimeException; @@ -1158,6 +1159,19 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService public PageInfo historyListByEmployeeIdAndOperator(SIArchiveBaseHistoryListParam param) { List adjustHistoryDTOS = siArchivesBiz.getBaseHistoryByEmployeeIdAndOperator(param.getOperator(), param.getEmployeeId()); + adjustHistoryDTOS.forEach(f -> { + if (StringUtils.isNotBlank(f.getPaymentScope())) { + if(f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue().toString())) { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "个人")); + } else if(f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_COMPANY.getValue().toString())) { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "公司")); + } else { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "个人") + "," + SalaryI18nUtil.getI18nLabel(0, "公司")); + } + } else { + f.setPaymentScope(SalaryI18nUtil.getI18nLabel(0, "个人") + "," + SalaryI18nUtil.getI18nLabel(0, "公司")); + } + }); PageInfo listPage = SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), adjustHistoryDTOS , InsuranceArchivesBaseHistoryDTO.class); diff --git a/src/com/engine/salary/service/impl/SIImportServiceImpl.java b/src/com/engine/salary/service/impl/SIImportServiceImpl.java index 8fc7eccdb..c8b41704c 100644 --- a/src/com/engine/salary/service/impl/SIImportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIImportServiceImpl.java @@ -27,6 +27,7 @@ import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; @@ -184,7 +185,7 @@ public class SIImportServiceImpl extends Service implements SIImportService { //工作簿数据 - return ExcelUtil.genWorkbookV2(excelSheetData, sheetName,excelComments); + return ExcelUtilPlus.genWorkbookV2(excelSheetData, sheetName,excelComments); } @@ -194,6 +195,7 @@ public class SIImportServiceImpl extends Service implements SIImportService { * @return */ public List buildHeader() { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); List result = new ArrayList<>(); result.add(SalaryI18nUtil.getI18nLabel( 85429, "姓名")); result.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); @@ -206,7 +208,13 @@ public class SIImportServiceImpl extends Service implements SIImportService { // result.add(SalaryI18nUtil.getI18nLabel( 91325, "社保缴纳组织")); //社保福利基数 Map socialMap = welfareNameIdMap( WelfareTypeEnum.SOCIAL_SECURITY); - socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"))); + if (welBaseDiffSign) { + socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"))); + socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"))); + } else { + socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数"))); + } + result.add(SalaryI18nUtil.getI18nLabel( 91324, "社保账号")); result.add(SalaryI18nUtil.getI18nLabel( 91319, "社保起始缴纳月")); result.add(SalaryI18nUtil.getI18nLabel( 91320, "社保最后缴纳月")); @@ -215,7 +223,13 @@ public class SIImportServiceImpl extends Service implements SIImportService { result.add(SalaryI18nUtil.getI18nLabel( 91486, "公积金账号")); //公积金福利基数 Map fundMap = welfareNameIdMap( WelfareTypeEnum.ACCUMULATION_FUND); - fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"))); + if (welBaseDiffSign) { + fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"))); + fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"))); + } else { + fundMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数"))); + } + result.add(SalaryI18nUtil.getI18nLabel( 91487, "补充公积金账号")); result.add(SalaryI18nUtil.getI18nLabel( 91483, "公积金起始缴纳月")); result.add(SalaryI18nUtil.getI18nLabel( 91484, "公积金最后缴纳月")); @@ -223,7 +237,13 @@ public class SIImportServiceImpl extends Service implements SIImportService { // result.add(SalaryI18nUtil.getI18nLabel( 91497, "其他福利缴纳组织")); //其他福利基数 Map otherMap = welfareNameIdMap( WelfareTypeEnum.OTHER); - otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"))); + if (welBaseDiffSign) { + otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"))); + otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"))); + } else { + otherMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 0, "申报基数"))); + } + result.add(SalaryI18nUtil.getI18nLabel( 91490, "其他福利起始缴纳月")); result.add(SalaryI18nUtil.getI18nLabel( 91494, "其他福利最后缴纳月")); return result; diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index d49f971e2..295fd5615 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -1084,16 +1084,40 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesOtherSchemePO = buildOtherPO(employeeId, welfareMap, singleAccount, schemeNameIdMap, paymentNameIdMap, creator); } /**************校验申报基数**************/ - for (Map.Entry entry : welfareMap.entrySet()) { - String keyName = entry.getValue() + SalaryI18nUtil.getI18nLabel(100293, "申报基数"); - String numberVlue = findElement(singleAccount, keyName).get(keyName) == null ? "" : findElement(singleAccount, keyName).get(keyName).toString(); - if (!"".equals(numberVlue) && !NumberUtils.isParsable(numberVlue)) { - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + keyName + SalaryI18nUtil.getI18nLabel(100581, "请输入数字")); - excelComments.add(errorMessageMap); - isError = true; + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + if (welBaseDiffSign) { + for (Map.Entry entry : welfareMap.entrySet()) { + String keyPerName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人"); + String keyComName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位"); + String numberPerValue = findElement(singleAccount, keyPerName).get(keyPerName) == null ? "" : findElement(singleAccount, keyPerName).get(keyPerName).toString(); + String numberComValue = findElement(singleAccount, keyComName).get(keyComName) == null ? "" : findElement(singleAccount, keyComName).get(keyComName).toString(); + + if (!"".equals(numberPerValue) && !NumberUtils.isParsable(numberPerValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + keyPerName + SalaryI18nUtil.getI18nLabel(0, "请输入数字")); + excelComments.add(errorMessageMap); + isError = true; + } + if (!"".equals(numberComValue) && !NumberUtils.isParsable(numberComValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + keyComName + SalaryI18nUtil.getI18nLabel(0, "请输入数字")); + excelComments.add(errorMessageMap); + isError = true; + } + } + } else { + for (Map.Entry entry : welfareMap.entrySet()) { + String keyName = entry.getValue() + SalaryI18nUtil.getI18nLabel(0, "申报基数"); + String numberValue = findElement(singleAccount, keyName).get(keyName) == null ? "" : findElement(singleAccount, keyName).get(keyName).toString(); + if (!"".equals(numberValue) && !NumberUtils.isParsable(numberValue)) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + keyName + SalaryI18nUtil.getI18nLabel(0, "请输入数字")); + excelComments.add(errorMessageMap); + isError = true; + } } } + //生成福利档案基础信息数据 InsuranceArchivesBaseInfoPO insuranceArchivesBaseInfoPO = buildBaseInfoPO(employeeId, singleAccount, paymentNameIdMap, creator, runStatus, employees.get(0).isExtEmp()); if (!isError) { @@ -1108,17 +1132,25 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { Boolean otherCheckBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue()); - if (socialCheckBase && fundCheckBase && otherCheckBase) { + Boolean socialCheckComBase = true; + Boolean fundCheckComBase = true; + Boolean otherCheckComBase = true; + if (welBaseDiffSign) { + socialCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherCheckComBase = siArchivesBiz.checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue()); + } + if (socialCheckBase && fundCheckBase && otherCheckBase && socialCheckComBase && fundCheckComBase && otherCheckComBase) { insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO); } else { String checkMessage = "该条数据中"; - if (!socialCheckBase) { + if (!socialCheckBase || !socialCheckComBase) { checkMessage = checkMessage + "社保福利基数、"; } - if (!fundCheckBase) { + if (!fundCheckBase || !fundCheckComBase) { checkMessage = checkMessage + "公积金福利基数、"; } - if (!otherCheckBase) { + if (!otherCheckBase || !otherCheckComBase) { checkMessage = checkMessage + "其他福利基数、"; } checkMessage = checkMessage.substring(0, checkMessage.length() - 1); @@ -1162,12 +1194,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { String socialAccount = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91324, "社保账号")).get(SalaryI18nUtil.getI18nLabel(91324, "社保账号")); Long socialSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")).get(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"))); HashMap oldSocialBaseMap = new HashMap<>(); + HashMap oldSocialComBaseMap = new HashMap<>(); if (oldSocialSchemeInfos.size() > 0) { oldSocialSchemePO = oldSocialSchemeInfos.get(0); encryptUtil.decrypt(oldSocialSchemePO, InsuranceArchivesSocialSchemePO.class); BeanUtils.copyProperties(oldSocialSchemePO, insuranceArchivesSocialSchemePO); //社保基数 oldSocialBaseMap = JSON.parseObject(oldSocialSchemePO.getSocialPaymentBaseString(), new HashMap().getClass()); + oldSocialComBaseMap = JSON.parseObject(oldSocialSchemePO.getSocialPaymentComBaseString(), new HashMap().getClass()); } insuranceArchivesSocialSchemePO.setId(IdGenerator.generate()); @@ -1202,21 +1236,48 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesSocialSchemePO.setUnderTake(UndertakerEnum.SCOPE_PERSON.getValue()); List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesSocialSchemePO.getSocialSchemeId()); encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); HashMap socialPaymentBase = new HashMap<>(); + HashMap socialPaymentComBase = new HashMap<>(); for (Long insuranceId : insuranceIds) { if (StringUtils.isBlank(welfareMap.get(insuranceId))) { continue; } - if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) { - String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); - if (StringUtils.isNotBlank(itemValue)) { - socialPaymentBase.put(String.valueOf(insuranceId), itemValue); - } else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) { - socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId))); + if (welBaseDiffSign) { + Map itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (itemPerMap != null) { + String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (StringUtils.isNotBlank(itemValue)) { + socialPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) { + socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId))); + } + } + Map itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (itemComMap != null) { + String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (StringUtils.isNotBlank(itemValue)) { + socialPaymentComBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldSocialComBaseMap != null && StringUtils.isNotBlank(oldSocialComBaseMap.get(String.valueOf(insuranceId)))) { + socialPaymentComBase.put(String.valueOf(insuranceId), oldSocialComBaseMap.get(String.valueOf(insuranceId))); + } + } + insuranceArchivesSocialSchemePO.setSocialPaymentComBaseString(JSON.toJSONString(socialPaymentComBase)); + } else { + Map itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (itemMap != null) { + String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (StringUtils.isNotBlank(itemValue)) { + socialPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldSocialBaseMap != null && StringUtils.isNotBlank(oldSocialBaseMap.get(String.valueOf(insuranceId)))) { + socialPaymentBase.put(String.valueOf(insuranceId), oldSocialBaseMap.get(String.valueOf(insuranceId))); + } } } + } insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(JSON.toJSONString(socialPaymentBase)); } @@ -1243,12 +1304,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { String supplementFundAccount = (String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")).get(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")); Long fundSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")).get(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称"))); HashMap oldFundBaseMap = new HashMap<>(); + HashMap oldFundComBaseMap = new HashMap<>(); if (oldFundSchemeInfos.size() > 0) { oldFundSchemePO = oldFundSchemeInfos.get(0); encryptUtil.decrypt(oldFundSchemePO, InsuranceArchivesFundSchemePO.class); BeanUtils.copyProperties(oldFundSchemePO, insuranceArchivesFundSchemePO); //社保基数 oldFundBaseMap = JSON.parseObject(oldFundSchemePO.getFundPaymentBaseString(), new HashMap().getClass()); + oldFundComBaseMap = JSON.parseObject(oldFundSchemePO.getFundPaymentComBaseString(), new HashMap().getClass()); } insuranceArchivesFundSchemePO.setId(IdGenerator.generate()); @@ -1286,24 +1349,49 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesFundSchemePO.getFundSchemeId()); encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); - HashMap socialPaymentBase = new HashMap<>(); + HashMap fundPaymentBase = new HashMap<>(); + HashMap fundPaymentComBase = new HashMap<>(); for (Long insuranceId : insuranceIds) { if (StringUtils.isBlank(welfareMap.get(insuranceId))) { continue; } - if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) { - String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); - if (StringUtils.isNotBlank(itemValue)) { - socialPaymentBase.put(String.valueOf(insuranceId), itemValue); - } else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) { - socialPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId))); + if (welBaseDiffSign) { + Map itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (itemPerMap != null) { + String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (StringUtils.isNotBlank(itemValue)) { + fundPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) { + fundPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId))); + } + } + Map itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (itemComMap != null) { + String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (StringUtils.isNotBlank(itemValue)) { + fundPaymentComBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldFundComBaseMap != null && StringUtils.isNotBlank(oldFundComBaseMap.get(String.valueOf(insuranceId)))) { + fundPaymentComBase.put(String.valueOf(insuranceId), oldFundComBaseMap.get(String.valueOf(insuranceId))); + } + } + insuranceArchivesFundSchemePO.setFundPaymentComBaseString(JSON.toJSONString(fundPaymentComBase)); + } else { + Map itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (itemMap != null) { + String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (StringUtils.isNotBlank(itemValue)) { + fundPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldFundBaseMap != null && StringUtils.isNotBlank(oldFundBaseMap.get(String.valueOf(insuranceId)))) { + fundPaymentBase.put(String.valueOf(insuranceId), oldFundBaseMap.get(String.valueOf(insuranceId))); + } } - } + } - insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(socialPaymentBase)); + insuranceArchivesFundSchemePO.setFundPaymentBaseString(JSON.toJSONString(fundPaymentBase)); } return insuranceArchivesFundSchemePO; } @@ -1325,12 +1413,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { //设置其他福利方案、起始缴纳月、最后缴纳月 Long otherSchemeId = schemeNameIdMap.get((String) findElement(singleAccount, SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")).get(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称"))); HashMap oldOtherBaseMap = new HashMap<>(); + HashMap oldOtherComBaseMap = new HashMap<>(); if (oldOtherSchemeInfos.size() > 0) { oldOtherSchemePO = oldOtherSchemeInfos.get(0); encryptUtil.decrypt(oldOtherSchemePO, InsuranceArchivesOtherSchemePO.class); BeanUtils.copyProperties(oldOtherSchemePO, insuranceArchivesOtherSchemePO); //社保基数 oldOtherBaseMap = JSON.parseObject(oldOtherSchemePO.getOtherPaymentBaseString(), new HashMap().getClass()); + oldOtherComBaseMap = JSON.parseObject(oldOtherSchemePO.getOtherPaymentComBaseString(), new HashMap().getClass()); } insuranceArchivesOtherSchemePO.setId(IdGenerator.generate()); @@ -1361,24 +1451,49 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { insuranceArchivesOtherSchemePO.setEmployeeId(employeeId); List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(insuranceArchivesOtherSchemePO.getOtherSchemeId()); encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (CollectionUtils.isNotEmpty(insuranceSchemeDetailPOS)) { List insuranceIds = insuranceSchemeDetailPOS.stream().map(InsuranceSchemeDetailPO::getInsuranceId).collect(Collectors.toList()); - HashMap socialPaymentBase = new HashMap<>(); + HashMap otherPaymentBase = new HashMap<>(); + HashMap otherPaymentComBase = new HashMap<>(); for (Long insuranceId : insuranceIds) { if (StringUtils.isBlank(welfareMap.get(insuranceId))) { continue; } - if (findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")) != null) { - String itemValue = (String) findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")).get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); - if (StringUtils.isNotBlank(itemValue)) { - socialPaymentBase.put(String.valueOf(insuranceId), itemValue); - } else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) { - socialPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId))); + if (welBaseDiffSign) { + Map itemPerMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (itemPerMap != null) { + String itemValue = (String) itemPerMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "个人")); + if (StringUtils.isNotBlank(itemValue)) { + otherPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) { + otherPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId))); + } + } + Map itemComMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (itemComMap != null) { + String itemValue = (String) itemComMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0, "单位")); + if (StringUtils.isNotBlank(itemValue)) { + otherPaymentComBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldOtherComBaseMap != null && StringUtils.isNotBlank(oldOtherComBaseMap.get(String.valueOf(insuranceId)))) { + otherPaymentComBase.put(String.valueOf(insuranceId), oldOtherComBaseMap.get(String.valueOf(insuranceId))); + } + } + insuranceArchivesOtherSchemePO.setOtherPaymentComBaseString(JSON.toJSONString(otherPaymentComBase)); + } else { + Map itemMap = findElement(singleAccount, welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (itemMap != null) { + String itemValue = (String) itemMap.get(welfareMap.get(insuranceId) + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + if (StringUtils.isNotBlank(itemValue)) { + otherPaymentBase.put(String.valueOf(insuranceId), itemValue); + } else if (oldOtherBaseMap != null && StringUtils.isNotBlank(oldOtherBaseMap.get(String.valueOf(insuranceId)))) { + otherPaymentBase.put(String.valueOf(insuranceId), oldOtherBaseMap.get(String.valueOf(insuranceId))); + } } - } + } - insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(socialPaymentBase)); + insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(JSON.toJSONString(otherPaymentBase)); } return insuranceArchivesOtherSchemePO; } From bb1b785f55e432d08fe5014c2ee7ff54d3067a2c Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 7 Dec 2023 11:06:19 +0800 Subject: [PATCH 05/12] =?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=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=A0=B9=E6=8D=AE=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E5=9F=BA=E6=95=B0=E9=80=BB=E8=BE=91=E6=94=B9=E9=80=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 35 +-- .../service/impl/SISchemeServiceImpl.java | 259 ++++++++++++++---- 2 files changed, 212 insertions(+), 82 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index fbf526ca6..32186cbbb 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -1520,26 +1520,22 @@ public class SIArchivesBiz { socialCollect.putAll(customSocial); socialCollect.putAll(sysSocial); -// socialSet.forEach(item -> { -// if (socialCollect.containsKey(Long.valueOf(item))) { -// socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); -// } -// }); + if (welBaseDiffSign) { socialSet.forEach(item -> { if (socialCollect.containsKey(Long.valueOf(item))) { - socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "个人"); + socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); } }); socialComSet.forEach(item -> { if (socialCollect.containsKey(Long.valueOf(item))) { - socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "单位"); + socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); } }); } else { socialSet.forEach(item -> { if (socialCollect.containsKey(Long.valueOf(item))) { - socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); + socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); } }); } @@ -1550,26 +1546,21 @@ public class SIArchivesBiz { Map sysFund = iCategoryMapper.listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); fundCollect.putAll(customFund); fundCollect.putAll(sysFund); -// fundSet.forEach(item -> { -// if (fundCollect.containsKey(Long.valueOf(item))) { -// fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); -// } -// }); if (welBaseDiffSign) { fundSet.forEach(item -> { if (fundCollect.containsKey(Long.valueOf(item))) { - fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "个人"); + fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); } }); fundComSet.forEach(item -> { if (fundCollect.containsKey(Long.valueOf(item))) { - fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "单位"); + fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); } }); } else { fundSet.forEach(item -> { if (fundCollect.containsKey(Long.valueOf(item))) { - fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); + fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); } }); } @@ -1580,26 +1571,22 @@ public class SIArchivesBiz { Map sysOther = iCategoryMapper.listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); otherCollect.putAll(customOther); otherCollect.putAll(sysOther); -// otherSet.forEach(item -> { -// if (otherCollect.containsKey(Long.valueOf(item))) { -// otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); -// } -// }); + if (welBaseDiffSign) { otherSet.forEach(item -> { if (otherCollect.containsKey(Long.valueOf(item))) { - otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "个人"); + otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); } }); otherComSet.forEach(item -> { if (otherCollect.containsKey(Long.valueOf(item))) { - otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数" + "单位"); + otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); } }); } else { otherSet.forEach(item -> { if (otherCollect.containsKey(Long.valueOf(item))) { - otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + "申报基数"); + otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); } }); } diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 295fd5615..5b2552ef9 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -51,6 +51,7 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.engine.salary.util.valid.ValidUtil; @@ -261,6 +262,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { @Override public List> buildTableData(List insuranceArchivesEmployeePOS) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); List> records = new ArrayList<>(); List taxAgentPOS = getTaxAgentMapper().listAll(); Map longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); @@ -286,9 +288,6 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { Map fundSchemePOMap = SalaryEntityUtil.convert2Map(fundList, k -> k.getPaymentOrganization() + "-" + k.getEmployeeId()); Map otherSchemePOMap = SalaryEntityUtil.convert2Map(otherList, k -> k.getPaymentOrganization() + "-" + k.getEmployeeId()); -// Map socialSchemePOMap = socialList.stream().collect(Collectors.toMap(InsuranceArchivesSocialSchemePO::getEmployeeId, Function.identity())); -// Map fundSchemePOMap = fundList.stream().collect(Collectors.toMap(InsuranceArchivesFundSchemePO::getEmployeeId, Function.identity())); -// Map otherSchemePOMap = otherList.stream().collect(Collectors.toMap(InsuranceArchivesOtherSchemePO::getEmployeeId, Function.identity())); insuranceArchivesEmployeePOS.forEach(item -> { InsuranceArchivesSocialSchemePO socialItem = socialSchemePOMap.get(item.getPaymentOrganization() + "-" + item.getEmployeeId()); InsuranceArchivesFundSchemePO fundItem = fundSchemePOMap.get(item.getPaymentOrganization() + "-" + item.getEmployeeId()); @@ -307,15 +306,37 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("socialName", getSiSchemeService().querySchemeName(socialItem.getSocialSchemeId())); Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { }); - if (socialJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); - socialJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(socialItem.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(socialJson); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(socialItem.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(socialItem.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } map.put("socialAccount", socialItem.getSocialAccount()); map.put("socialStartTime", socialItem.getSocialStartTime()); @@ -326,15 +347,37 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("fundAccount", fundItem.getFundAccount()); Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { }); - if (fundJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); - fundJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(fundJson); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(fundItem.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(fundItem.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); map.put("fundStartTime", fundItem.getFundStartTime()); @@ -345,15 +388,37 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("otherName", getSiSchemeService().querySchemeName(otherItem.getOtherSchemeId())); Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { }); - if (otherJson != null) { - //查询该福利方案下开启缴纳的福利项 - List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); - otherJson.forEach((k, v) -> { - if (insuranceIdList.contains(Long.valueOf(k))) { - map.put(k, v); - } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "per", v); + } + }); + } + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { }); -// map.putAll(otherJson); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(otherItem.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k + "com", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = payInsuranceIds(otherItem.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + map.put(k, v); + } + }); + } } map.put("otherStartTime", otherItem.getOtherStartTime()); map.put("otherEndTime", otherItem.getOtherEndTime()); @@ -422,11 +487,11 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } //工作簿数据 - List> rows = new LinkedList<>(); - List collect = columns.stream().map(WeaTableColumn::getText).collect(Collectors.toList()); + List> rows = new LinkedList<>(); + List collect = columns.stream().map(WeaTableColumn::getText).collect(Collectors.toList()); rows.add(collect); for (Map recordData : records) { - List row = new LinkedList<>(); + List row = new LinkedList<>(); for (WeaTableColumn column : columns) { try { Object o = recordData.get(column.getColumn()); @@ -437,20 +502,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } rows.add(row); } -// return salaryBatchService.simpleExportExcel(ExportExcelInfo.builder() -// .bizId(exportMap.get("biz")) -// .flag(true) -// .userId(employeeId) -// .eteamsId(eteamsId) -// .tenantKey(tenantKey) -// .operator(operator) -// .module(exportMap.get("module")) -// .fileName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 94629, "社保福利档案") + SalaryDateUtil.getFormatLocalDateTime(LocalDateTime.now())) -// .handlerName("insuranceArchivesExportHandler") -// .dataType(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 99915, "档案")) -// .function(exportMap.get("function")).build(), sheetList); //获取excel - return ExcelUtil.genWorkbook(rows, sheetName); + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -532,10 +585,17 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { public Map> buildColumnTitle(List insuranceArchivesEmployeePOS, Long employeeId) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + Map> result = new HashMap<>(); Set socialSet = new HashSet<>(); Set fundSet = new HashSet<>(); Set otherSet = new HashSet<>(); + + Set socialComSet = new HashSet<>(); + Set fundComSet = new HashSet<>(); + Set otherComSet = new HashSet<>(); + insuranceArchivesEmployeePOS.forEach(item -> { List socialByEmployeeId = siArchivesBiz.getSocialByEmployeeIds(new ArrayList() {{ add(item.getEmployeeId()); @@ -571,6 +631,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (socialJson != null) { socialJson.forEach((k, v) -> socialSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(socialItem.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socialComSet.add(k)); + } + } } if (fundItem != null) { Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { @@ -578,6 +646,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (fundJson != null) { fundJson.forEach((k, v) -> fundSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(fundItem.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComSet.add(k)); + } + } } if (otherItem != null) { Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { @@ -585,42 +661,92 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { if (otherJson != null) { otherJson.forEach((k, v) -> otherSet.add(k)); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(otherItem.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComSet.add(k)); + } + } } }); Map socialMap = new HashMap<>(); + Map socialComMap = new HashMap<>(); Map socialCollect = new HashMap<>(); Map customSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysSocial = getICategoryMapper().listByWelfareType(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); socialCollect.putAll(customSocial); socialCollect.putAll(sysSocial); - socialSet.forEach(item -> { - if (socialCollect.containsKey(Long.valueOf(item))) { - socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); - } - }); + if (welBaseDiffSign) { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item + "per", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + socialComSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialComMap.put(item + "com", socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + socialSet.forEach(item -> { + if (socialCollect.containsKey(Long.valueOf(item))) { + socialMap.put(item, socialCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } + }); + } Map fundMap = new HashMap<>(); + Map fundComMap = new HashMap<>(); Map fundCollect = new HashMap<>(); Map customFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysFund = getICategoryMapper().listByWelfareType(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); fundCollect.putAll(customFund); fundCollect.putAll(sysFund); - fundSet.forEach(item -> { - if (fundCollect.containsKey(Long.valueOf(item))) { - fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); - } - }); + if (welBaseDiffSign) { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item + "per", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + fundComSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundComMap.put(item + "com", fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + fundSet.forEach(item -> { + if (fundCollect.containsKey(Long.valueOf(item))) { + fundMap.put(item, fundCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } + }); + } Map otherMap = new HashMap<>(); + Map otherComMap = new HashMap<>(); Map otherCollect = new HashMap<>(); Map customOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), null).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); Map sysOther = getICategoryMapper().listByWelfareType(WelfareTypeEnum.OTHER.getValue(), DataTypeEnum.SYSTEM.getValue()).stream().collect(Collectors.toMap(ICategoryPO::getId, Function.identity())); otherCollect.putAll(customOther); otherCollect.putAll(sysOther); - otherSet.forEach(item -> { - if (otherCollect.containsKey(Long.valueOf(item))) { - otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(100293, "申报基数")); - } - }); + if (welBaseDiffSign) { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item + "per", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + }); + otherComSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherComMap.put(item + "com", otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + }); + } else { + otherSet.forEach(item -> { + if (otherCollect.containsKey(Long.valueOf(item))) { + otherMap.put(item, otherCollect.get(Long.valueOf(item)).getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } + }); + } // map根据key排序 LinkedHashMap socialMapWithAscKey = socialMap.entrySet().stream() @@ -635,6 +761,23 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { .sorted(Map.Entry.comparingByKey()) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComMap.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialMapWithAscKey.putAll(socialComMapWithAscKey); + fundMapWithAscKey.putAll(fundComMapWithAscKey); + otherMapWithAscKey.putAll(otherComMapWithAscKey); + } result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialMapWithAscKey); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundMapWithAscKey); From 1c5249c76e1bf3aac4f4ed3096863eda22aa819c Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 8 Dec 2023 11:16:18 +0800 Subject: [PATCH 06/12] =?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=E3=80=81=E6=98=8E=E7=BB=86=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E3=80=81=E5=AF=BC=E5=87=BA=E6=95=B0=E6=8D=AE=EF=BC=8C=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=8B=86=E5=88=86=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8=E5=9F=BA=E6=95=B0?= =?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/biz/SIAccountBiz.java | 80 +++++- .../bo/InsuranceComparisonResultBO.java | 81 +++++- .../siaccount/po/ExcelInsuranceDetailPO.java | 18 ++ .../po/InsuranceAccountDetailTempPO.java | 18 ++ .../InsuranceAccountDetailMapper.xml | 36 ++- .../siaccount/SIAccountDetailTempMapper.xml | 30 ++- .../service/impl/ColumnBuildServiceImpl.java | 127 +++++++-- .../service/impl/RecordsBuildServiceImpl.java | 129 ++++++++- .../impl/SIAComparisonResultServiceImpl.java | 8 +- .../service/impl/SIAccountServiceImpl.java | 54 +++- .../service/impl/SIExportServiceImpl.java | 250 +++++++++++++++--- .../service/impl/SIRecessionServiceImpl.java | 3 + .../salary/web/SIAccountController.java | 4 +- 13 files changed, 730 insertions(+), 108 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 34b6aae17..c6df56a19 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -631,11 +631,13 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getOther() != null) { InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther(); insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization()); insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId()); insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString()); + insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), otherPO.getOtherStartTime(), otherPO.getOtherEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) { @@ -719,7 +721,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + } //需要核算其他的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -742,10 +750,11 @@ public class SIAccountBiz extends Service { List otherComList = new ArrayList<>(); Map otherComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = otherCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -787,6 +796,7 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getFund() != null) { InsuranceArchivesFundSchemePO fundPO = accountPO.getFund(); insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization()); @@ -794,6 +804,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount()); insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); + insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), fundPO.getFundStartTime(), fundPO.getFundEndTime()); if ((NonPaymentEnum.YES.getValue() == fundPO.getNonPayment() || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { @@ -876,7 +887,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + } //需要核算公积金的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -899,10 +916,11 @@ public class SIAccountBiz extends Service { List fundComList = new ArrayList<>(); Map fundComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = fundCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -945,12 +963,14 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getSocial() != null) { InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial(); insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization()); insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); if ((NonPaymentEnum.YES.getValue().equals(socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { @@ -1036,7 +1056,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + } //需要核算社保的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1059,10 +1085,11 @@ public class SIAccountBiz extends Service { List socialCom = new ArrayList<>(); Map sociaComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = schemeCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1510,7 +1537,6 @@ public class SIAccountBiz extends Service { } else { accountFund(insuranceAccountDetailPO, accountPO, baseParam.getSupplementaryMonth()); } - } if (projects.contains(ProjectTypeEnum.OTHER.getValue())) { @@ -1532,11 +1558,13 @@ public class SIAccountBiz extends Service { public InsuranceAccountDetailPO accountOther(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getOther() != null) { InsuranceArchivesOtherSchemePO otherPO = accountPO.getOther(); insuranceAccountDetailPO.setOtherPayOrg(otherPO.getPaymentOrganization()); insuranceAccountDetailPO.setOtherSchemeId(otherPO.getOtherSchemeId()); insuranceAccountDetailPO.setOtherPaymentBaseString(otherPO.getOtherPaymentBaseString()); + insuranceAccountDetailPO.setOtherPaymentComBaseString(otherPO.getOtherPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, otherPO.getOtherStartTime(), otherPO.getOtherEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) { @@ -1611,7 +1639,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(otherPO.getOtherPaymentBaseString(), new HashMap().getClass()); + } //需要核算其他的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1626,10 +1660,11 @@ public class SIAccountBiz extends Service { List otherComList = new ArrayList<>(); Map otherComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = otherCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1671,6 +1706,7 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountFund(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getFund() != null) { InsuranceArchivesFundSchemePO fundPO = accountPO.getFund(); insuranceAccountDetailPO.setFundPayOrg(fundPO.getPaymentOrganization()); @@ -1678,6 +1714,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSupplementFundAccount(fundPO.getSupplementFundAccount()); insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); + insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, fundPO.getFundStartTime(), fundPO.getFundEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), fundPO.getNonPayment()) || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { @@ -1751,7 +1788,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(fundPO.getFundPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); + } //需要核算公积金的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1766,10 +1809,11 @@ public class SIAccountBiz extends Service { List fundComList = new ArrayList<>(); Map fundComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = fundCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1812,12 +1856,14 @@ public class SIAccountBiz extends Service { } public InsuranceAccountDetailPO accountSocial(InsuranceAccountDetailPO insuranceAccountDetailPO, InsuranceArchivesAccountPO accountPO, String billMonth) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); if (accountPO.getSocial() != null) { InsuranceArchivesSocialSchemePO socialPO = accountPO.getSocial(); insuranceAccountDetailPO.setSocialPayOrg(socialPO.getPaymentOrganization()); insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { @@ -1896,7 +1942,13 @@ public class SIAccountBiz extends Service { .collect( Collectors.toMap(InsuranceSchemeDetailPO::getInsuranceId, Function.identity())); //档案中包含的基数信息 - HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); +// HashMap archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + HashMap archivesCom = new HashMap<>(); + if (welBaseDiffSign) { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentComBaseString(), new HashMap().getClass()); + } else { + archivesCom = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + } //需要核算社保的福利id 单位 List needArchivesCom = new ArrayList<>(); if (archivesCom != null) { @@ -1911,10 +1963,11 @@ public class SIAccountBiz extends Service { List socialCom = new ArrayList<>(); Map sociaComJsonMap = new HashMap<>(); + HashMap finalArchivesCom = archivesCom; needArchivesCom.stream().forEach(e -> { InsuranceSchemeDetailPO po = schemeCom.get(e); BigDecimal paymentProportion = new BigDecimal(StringUtils.isBlank(po.getPaymentProportion()) ? "0" : po.getPaymentProportion()).divide(new BigDecimal("100")); - BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(archivesCom) || StringUtils.isBlank(archivesCom.get(String.valueOf(e)))) ? "0" : archivesCom.get(String.valueOf(e))); + BigDecimal paymentNum = new BigDecimal((ObjectUtils.isEmpty(finalArchivesCom) || StringUtils.isBlank(finalArchivesCom.get(String.valueOf(e)))) ? "0" : finalArchivesCom.get(String.valueOf(e))); BigDecimal fixedCost = StringUtils.isBlank(po.getFixedCost()) ? new BigDecimal("0") : new BigDecimal(po.getFixedCost()); Integer newScale = po.getValidNum() == null ? 0 : po.getValidNum(); // BigDecimal result = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), paymentNum.multiply(paymentProportion).add(fixedCost)); @@ -1964,6 +2017,7 @@ public class SIAccountBiz extends Service { insuranceAccountDetailPO.setSocialAccount(socialPO.getSocialAccount()); insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); + insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); diff --git a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java index 6a85ddd20..79909c1e2 100644 --- a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java +++ b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java @@ -41,7 +41,7 @@ public class InsuranceComparisonResultBO { * 构建福利核算结果列表的表头(线下对比) * */ - public static List buildTableColumns4ComparisonResult(Set insuranceBaseSet, Set insurancePerPaySet, Set insuranceComPaySet) { + public static List buildTableColumns4ComparisonResult(Set insuranceBaseSet, Set insurancePerPaySet, Set insuranceComPaySet, boolean welBaseDiffSign) { List listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); List socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); @@ -67,21 +67,63 @@ public class InsuranceComparisonResultBO { columns.add(new Column("社保账号", "socialAccount", "socialAccount")); columns.add(new Column("社保方案名称", "socialSchemeName", "socialSchemeName")); //组装社保基数 - for (ICategoryPO po : socialWelfareList) { - columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase")); + if (welBaseDiffSign) { + List socialComColumns = Lists.newArrayList(); + for (ICategoryPO po : socialWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人") + , po.getId() + "socialPerBase", po.getId() + "socialPerBase")); + socialComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位") + , po.getId() + "socialComBase", po.getId() + "socialComBase")); + } + columns.addAll(socialComColumns); + } else { + for (ICategoryPO po : socialWelfareList) { + columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase")); + } } +// for (ICategoryPO po : socialWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "socialBase", po.getId() + "socialBase")); +// } columns.add(new Column("公积金账号", "fundAccount", "fundAccount")); columns.add(new Column("公积金方案名称", "fundSchemeName", "fundSchemeName")); //组装公积金基数 - for (ICategoryPO po : fundWelfareList) { - columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase")); + if (welBaseDiffSign) { + List fundComColumns = Lists.newArrayList(); + for (ICategoryPO po : fundWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人") + , po.getId() + "fundPerBase", po.getId() + "fundPerBase")); + fundComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位") + , po.getId() + "fundComBase", po.getId() + "fundComBase")); + } + columns.addAll(fundComColumns); + } else { + for (ICategoryPO po : fundWelfareList) { + columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase")); + } } +// for (ICategoryPO po : fundWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "fundBase", po.getId() + "fundBase")); +// } columns.add(new Column("补充公积金账号", "supplementFundAccount", "supplementFundAccount")); columns.add(new Column("其他福利方案名称", "otherSchemeName", "otherSchemeName")); //组装其他福利基数 - for (ICategoryPO po : otherWelfareList) { - columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase")); + if (welBaseDiffSign) { + List otherComColumns = Lists.newArrayList(); + for (ICategoryPO po : otherWelfareList) { + columns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人") + , po.getId() + "otherPerBase", po.getId() + "otherPerBase")); + otherComColumns.add(new Column(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位") + , po.getId() + "otherComBase", po.getId() + "otherComBase")); + } + columns.addAll(otherComColumns); + } else { + for (ICategoryPO po : otherWelfareList) { + columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase")); + } } +// for (ICategoryPO po : otherWelfareList) { +// columns.add(new Column(po.getInsuranceName() + "申报基数", po.getId() + "otherBase", po.getId() + "otherBase")); +// } //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelPerList) { @@ -127,7 +169,8 @@ public class InsuranceComparisonResultBO { * 构建福利核算线下对比结果 * */ - public static List> buildComparisonTableData(List accountExportPOS, List excelAccountExportPOS, Map schemeIdNameMap) { + public static List> buildComparisonTableData(List accountExportPOS, List excelAccountExportPOS + , Map schemeIdNameMap, boolean welBaseDiffSign) { Map> excelResultMap = SalaryEntityUtil.group2Map(excelAccountExportPOS, ExcelAccountExportPO::getEmployeeId); // Map> acctResultMap = SalaryEntityUtil.group2Map(accountExportPOS, AccountExportPO::getWorkcode); @@ -177,6 +220,28 @@ public class InsuranceComparisonResultBO { if (excelResultValueList != null && excelResultValueList.size() == 1) { excelAccountExportPO = excelResultValueList.get(0); } + if (welBaseDiffSign) { + //社保基数-个人,socialPaymentBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "PerBase", 1); + //公积金基数-个人,fundPaymentBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "PerBase", 2); + //其他福利基数-个人,otherPaymentBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "PerBase", 3); + + //社保基数-公司,socialPaymentComBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentComBaseString(), excelAccountExportPO.getSocialPaymentComBaseString(), "ComBase", 1); + //公积金基数-公司,fundPaymentComBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentComBaseString(), excelAccountExportPO.getFundPaymentComBaseString(), "ComBase", 2); + //其他福利基数-公司,otherPaymentComBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentComBaseString(), excelAccountExportPO.getOtherPaymentComBaseString(), "ComBase", 3); + } else { + //社保基数,socialPaymentBaseString + welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1); + //公积金基数,fundPaymentBaseString + welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "Base", 2); + //其他福利基数,otherPaymentBaseString + welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3); + } //社保基数,socialPaymentBaseString welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1); //公积金基数,fundPaymentBaseString diff --git a/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java b/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java index 4e7889544..9660b8602 100644 --- a/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java +++ b/src/com/engine/salary/entity/siaccount/po/ExcelInsuranceDetailPO.java @@ -101,6 +101,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; + /** * 公积金方案ID */ @@ -112,6 +118,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 其他福利方案id */ @@ -123,6 +135,12 @@ public class ExcelInsuranceDetailPO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + /** * 社保个人缴费明细 */ diff --git a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java index 50897c6b2..dc8c1c2c0 100644 --- a/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java +++ b/src/com/engine/salary/entity/siaccount/po/InsuranceAccountDetailTempPO.java @@ -102,6 +102,11 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String socialPaymentBaseString; + /** + * 社保缴纳基数——单位 + */ + @Encrypt + private String socialPaymentComBaseString; /** * 公积金方案ID */ @@ -113,6 +118,12 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String fundPaymentBaseString; + /** + * 公积金缴纳基数——单位 + */ + @Encrypt + private String fundPaymentComBaseString; + /** * 其他福利方案id */ @@ -124,6 +135,13 @@ public class InsuranceAccountDetailTempPO { @Encrypt private String otherPaymentBaseString; + /** + * 其他福利缴纳基数——单位 + */ + @Encrypt + private String otherPaymentComBaseString; + + /** * 社保个人缴费明细 */ diff --git a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml index 2e52ce986..925718b0b 100644 --- a/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/InsuranceAccountDetailMapper.xml @@ -18,10 +18,13 @@ + + + @@ -69,10 +72,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -117,10 +123,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -420,7 +429,8 @@ 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.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string + t.social_payment_base_string, t.fund_payment_base_string, t.other_payment_base_string, + t.social_payment_com_base_string, t.fund_payment_com_base_string, t.other_payment_com_base_string FROM hrsa_bill_detail t WHERE t.delete_type = 0 @@ -711,7 +721,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -757,7 +768,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -766,7 +780,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select #{item.employeeId,jdbcType=DOUBLE}, @@ -811,7 +826,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -821,7 +839,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.employeeId}, @@ -866,7 +885,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml b/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml index f99461416..19b6fb3e5 100644 --- a/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/SIAccountDetailTempMapper.xml @@ -18,10 +18,13 @@ + + + @@ -68,10 +71,13 @@ , t.other_pay_org , t.social_scheme_id , t.social_payment_base_string + , t.social_payment_com_base_string , t.fund_scheme_id , t.fund_payment_base_string + , t.fund_payment_com_base_string , t.other_scheme_id , t.other_payment_base_string + , t.other_payment_com_base_string , t.social_per_json , t.social_per_sum , t.fund_per_json @@ -130,7 +136,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -175,7 +182,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -184,7 +194,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select @@ -229,7 +240,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -239,7 +253,8 @@ (employee_id,bill_month,bill_status,payment_status,supplementary_month,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.employeeId}, @@ -283,7 +298,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java index f15ae19f1..5312f1c51 100644 --- a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java @@ -1,6 +1,7 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.cloudstore.eccom.constant.WeaBoolAttr; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.core.impl.Service; @@ -31,6 +32,8 @@ import java.util.stream.Collectors; **/ public class ColumnBuildServiceImpl extends Service implements ColumnBuildService { + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + private ICategoryMapper getICategoryMapper() { return MapperProxyFactory.getProxy(ICategoryMapper.class); } @@ -122,58 +125,128 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic } private Map> buildPaymentTitle(List pos, Map categoryIdNameMap, Long employeeId, String tenantKey) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); Set socailIds = new HashSet<>(); Set fundIds = new HashSet<>(); Set otherIds = new HashSet<>(); + + Set socailComIds = new HashSet<>(); + Set fundComIds = new HashSet<>(); + Set otherComIds = new HashSet<>(); + Map> result = new HashMap<>(); pos.stream().forEach(item -> { - if (StringUtils.isNotBlank(item.getSocialPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getSocialPaymentBaseString()) || StringUtils.isNotBlank(item.getSocialPaymentComBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); if(socialJson!=null){ socialJson.forEach((k, v) -> { socailIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socailComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getFundPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getFundPaymentBaseString()) || StringUtils.isNotBlank(item.getFundPaymentComBaseString())) { Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); if(fundJson!=null){ fundJson.forEach((k, v) -> { fundIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getOtherPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getOtherPaymentBaseString()) || StringUtils.isNotBlank(item.getOtherPaymentComBaseString())) { Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); if(otherJson!=null){ otherJson.forEach((k, v) -> { otherIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComIds.add(k)); + } + } } }); Map socialColumns = new HashMap<>(); Map fundColumns = new HashMap<>(); Map otherColumns = new HashMap<>(); - socailIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "socialBase"); - } - }); - fundIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"), social + "fundBase"); - } - }); - otherIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"), social + "otherBase"); - } - }); + + Map socialComColumns = new HashMap<>(); + Map fundComColumns = new HashMap<>(); + Map otherComColumns = new HashMap<>(); + + if (welBaseDiffSign) { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "socialPerBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "fundPerBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "otherPerBase"); + } + }); + + socailComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "socialComBase"); + } + }); + fundComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "fundComBase"); + } + }); + otherComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "otherComBase"); + } + }); + } else { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数"), social + "socialBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数"), social + "fundBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数"), social + "otherBase"); + } + }); + } + // map根据value排序 LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() .sorted(Map.Entry.comparingByValue()) @@ -188,6 +261,24 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialColumnsWithAscValue.putAll(socialComMapWithAscKey); + fundColumnsWithAscValue.putAll(fundComMapWithAscKey); + otherColumnsWithAscValue.putAll(otherComMapWithAscKey); + } + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); diff --git a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java index 138eb8cf1..a18ca32e0 100644 --- a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java @@ -1,6 +1,7 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SIArchivesBiz; @@ -15,6 +16,7 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.siaccount.BillStatusEnum; import com.engine.salary.enums.siaccount.ResourceFromEnum; +import com.engine.salary.enums.sicategory.PaymentScopeEnum; import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; @@ -60,8 +62,11 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); } + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + @Override public List> buildCommonRecords(List list, Long employeeId) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); List> result = new ArrayList<>(); if (CollectionUtils.isEmpty(list)) { return result; @@ -99,34 +104,130 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ record.put("socialAccount", item.getSocialAccount()); record.put("socialSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getSocialSchemeId())); - if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) { + if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString()) || StringUtils.isNotEmpty(item.getSocialPaymentComBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); - if(socialJson!=null){ - socialJson.forEach((k, v) -> { - record.put(k + "socialBase", (String) v); +// if(socialJson!=null){ +// socialJson.forEach((k, v) -> { +// record.put(k + "socialBase", (String) v); +// }); +// } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialPerBase", v); + } + }); + } + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { }); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialComBase", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialBase", v); + } + }); + } } } record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getFundPayOrg(),TaxAgentPO.builder().build())).getName()); record.put("fundAccount", item.getFundAccount()); record.put("fundSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getFundSchemeId())); record.put("supplementFundAccount", item.getSupplementFundAccount()); - if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); - if(socialJson!=null){ - socialJson.forEach((k, v) -> { - record.put(k + "fundBase", (String) v); + if (StringUtils.isNotEmpty(item.getFundPaymentBaseString()) || StringUtils.isNotEmpty(item.getFundPaymentComBaseString())) { + Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); +// if(fundJson!=null){ +// fundJson.forEach((k, v) -> { +// record.put(k + "fundBase", (String) v); +// }); +// } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundPerBase", v); + } + }); + } + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { }); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundComBase", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundBase", v); + } + }); + } } } record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getOtherPayOrg(),TaxAgentPO.builder().build())).getName()); record.put("otherSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getOtherSchemeId())); - if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); - if(socialJson!=null){ - socialJson.forEach((k, v) -> { - record.put(k + "otherBase", (String) v); + if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString()) || StringUtils.isNotEmpty(item.getOtherPaymentComBaseString())) { + Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); +// if(otherJson!=null){ +// otherJson.forEach((k, v) -> { +// record.put(k + "otherBase", (String) v); +// }); +// } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherPerBase", v); + } + }); + } + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { }); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherComBase", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherBase", v); + } + }); + } } } if (StringUtils.isNotEmpty(item.getSocialPerJson())) { diff --git a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java index 89f725a87..23587a874 100644 --- a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java @@ -2,6 +2,7 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.siaccount.bo.InsuranceComparisonResultBO; import com.engine.salary.entity.siaccount.dto.InsuranceComparisonResultListDTO; @@ -45,6 +46,8 @@ import java.util.stream.Collectors; public class SIAComparisonResultServiceImpl extends Service implements SIAComparisonResultService { private EncryptUtil encryptUtil = new EncryptUtil(); + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + private InsuranceExportMapper getInsuranceExportMapper() { return MapperProxyFactory.getProxy(InsuranceExportMapper.class); } @@ -140,6 +143,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar */ private InsuranceComparisonResultListDTO listByParam(boolean needPage, InsuranceComparisonResultQueryParam queryParam) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); //排序配置 OrderRuleVO orderRule = getSalarySysConfService(user).orderRule(); @@ -200,10 +204,10 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar Set insurancePerPaySet = new HashSet<>(insurancePerPayIds); Set insuranceComPaySet = new HashSet<>(insuranceComPayIds); //3-构建福利核算对比结果列表表头 - List weaTableColumns = InsuranceComparisonResultBO.buildTableColumns4ComparisonResult(insuranceBaseSet, insurancePerPaySet, insuranceComPaySet); + List weaTableColumns = InsuranceComparisonResultBO.buildTableColumns4ComparisonResult(insuranceBaseSet, insurancePerPaySet, insuranceComPaySet, welBaseDiffSign); //4-通过线上线下两份数据获得对比结果 Map schemeIdNameMap = getSISchemeService(user).getSchemeIdNameMap(); - List> resultMapList = InsuranceComparisonResultBO.buildComparisonTableData(accountExportPOS, excelAccountExportPOS, schemeIdNameMap); + List> resultMapList = InsuranceComparisonResultBO.buildComparisonTableData(accountExportPOS, excelAccountExportPOS, schemeIdNameMap, welBaseDiffSign); // 系统值和线下值一致的人员 if (queryParam.isOnlyDiffEmployee()) { diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 282a6f545..d9387e62c 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -65,6 +65,7 @@ import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelParseHelper; import com.engine.salary.util.excel.ExcelSupport; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.Column; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -2221,7 +2222,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { */ @Override public XSSFWorkbook exportComparisonWelfareTemplate(InsuranceAccountDetailParam param) { - + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); //查询线上福利核算记录 InsuranceExportParam insuranceExportParam = new InsuranceExportParam(); insuranceExportParam.setBillMonth(param.getBillMonth()); @@ -2279,20 +2280,57 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // "养老保险申报基数" // "医疗保险申报基数" // "工伤保险申报基数" - for (ICategoryPO po : socialWelfareList) { - headerList.add(po.getInsuranceName() + "申报基数"); +// for (ICategoryPO po : socialWelfareList) { +// headerList.add(po.getInsuranceName() + "申报基数"); +// } + //组装社保基数 + if (welBaseDiffSign) { + List socialComColumns = Lists.newArrayList(); + for (ICategoryPO po : socialWelfareList) { + headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + socialComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + headerList.addAll(socialComColumns); + } else { + for (ICategoryPO po : socialWelfareList) { + headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } } headerList.add(SalaryI18nUtil.getI18nLabel(91486, "公积金账号")); headerList.add(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")); //组装公积金基数 - for (ICategoryPO po : fundWelfareList) { - headerList.add(po.getInsuranceName() + "申报基数"); +// for (ICategoryPO po : fundWelfareList) { +// headerList.add(po.getInsuranceName() + "申报基数"); +// } + if (welBaseDiffSign) { + List fundComColumns = Lists.newArrayList(); + for (ICategoryPO po : fundWelfareList) { + headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + fundComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + headerList.addAll(fundComColumns); + } else { + for (ICategoryPO po : fundWelfareList) { + headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } } headerList.add(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")); headerList.add(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")); //组装其他福利基数 - for (ICategoryPO po : otherWelfareList) { - headerList.add(po.getInsuranceName() + "申报基数"); +// for (ICategoryPO po : otherWelfareList) { +// headerList.add(po.getInsuranceName() + "申报基数"); +// } + if (welBaseDiffSign) { + List otherComColumns = Lists.newArrayList(); + for (ICategoryPO po : otherWelfareList) { + headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + otherComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + headerList.addAll(otherComColumns); + } else { + for (ICategoryPO po : otherWelfareList) { + headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + } } //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelPerList) { @@ -2335,7 +2373,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { rows.add(headerList); String sheetName = "福利核算-线下对比导入模板"; - return ExcelUtil.genWorkbookV2(rows, sheetName); + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } /** diff --git a/src/com/engine/salary/service/impl/SIExportServiceImpl.java b/src/com/engine/salary/service/impl/SIExportServiceImpl.java index 1c351dfac..ac3ec8488 100644 --- a/src/com/engine/salary/service/impl/SIExportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIExportServiceImpl.java @@ -1,10 +1,12 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; import com.cloudstore.eccom.pc.table.WeaTableColumn; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.SIAccountBiz; +import com.engine.salary.biz.SIArchivesBiz; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; import com.engine.salary.entity.siaccount.param.InsuranceAccountDetailParam; @@ -17,6 +19,7 @@ import com.engine.salary.enums.siaccount.BillStatusEnum; import com.engine.salary.enums.siaccount.PaymentStatusEnum; import com.engine.salary.enums.siaccount.ResourceFromEnum; 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.mapper.InsuranceExportMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; @@ -37,6 +40,7 @@ import com.engine.salary.util.SalaryEnumUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import org.springframework.beans.BeanUtils; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; @@ -66,6 +70,8 @@ public class SIExportServiceImpl extends Service implements SIExportService { private SIAccountBiz siAccountBiz = new SIAccountBiz(); + private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); + private SISchemeService getSISchemeService(User user) { return ServiceUtil.getService(SISchemeServiceImpl.class, user); } @@ -242,11 +248,12 @@ public class SIExportServiceImpl extends Service implements SIExportService { } excelSheetData.addAll(rows); - return ExcelUtil.genWorkbookV2(excelSheetData, sheetName, total); + return ExcelUtilPlus.genWorkbookV2(excelSheetData, sheetName, total); } @Override public List> buildCommonRecords(List list) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); List> result = new ArrayList<>(); List paymentList = getTaxAgentMapper().listAll(); @@ -272,10 +279,42 @@ public class SIExportServiceImpl extends Service implements SIExportService { record.put("socialSchemeName", schemeIdNameMap.get(item.getSocialSchemeId())); if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); - if (socialJson != null) { - socialJson.forEach((k, v) -> { - record.put(k + "socialBase", v); +// if (socialJson != null) { +// socialJson.forEach((k, v) -> { +// record.put(k + "socialBase", v); +// }); +// } + if (welBaseDiffSign) { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(), PaymentScopeEnum.SCOPE_PERSON.getValue()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialPerBase", v); + } + }); + } + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { }); + if (socialComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + socialComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialComBase", v); + } + }); + } + } else { + if (socialJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getSocialSchemeId()); + socialJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "socialBase", v); + } + }); + } } } @@ -284,22 +323,86 @@ public class SIExportServiceImpl extends Service implements SIExportService { record.put("fundSchemeName", schemeIdNameMap.get(item.getFundSchemeId())); record.put("supplementFundAccount", item.getSupplementFundAccount()); if (StringUtils.isNotEmpty(item.getFundPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); - if (socialJson != null) { - socialJson.forEach((k, v) -> { - record.put(k + "fundBase", v); + Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); +// if (fundJson != null) { +// fundJson.forEach((k, v) -> { +// record.put(k + "fundBase", v); +// }); +// } + if (welBaseDiffSign) { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundPerBase", v); + } + }); + } + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { }); + if (fundComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + fundComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundComBase", v); + } + }); + } + } else { + if (fundJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getFundSchemeId()); + fundJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "fundBase", v); + } + }); + } } } record.put("otherPayOrg", paymentMap.get(item.getOtherPayOrg()) == null ? "" : paymentMap.get(item.getOtherPayOrg()).getName()); record.put("otherSchemeName", schemeIdNameMap.get(item.getOtherSchemeId())); if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) { - Map socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); - if (socialJson != null) { - socialJson.forEach((k, v) -> { - record.put(k + "otherBase", v); + Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); +// if (otherJson != null) { +// otherJson.forEach((k, v) -> { +// record.put(k + "otherBase", v); +// }); +// } + if (welBaseDiffSign) { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_PERSON.getValue()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherPerBase", v); + } + }); + } + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { }); + if (otherComJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId(),PaymentScopeEnum.SCOPE_COMPANY.getValue()); + otherComJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherComBase", v); + } + }); + } + } else { + if (otherJson != null) { + //查询该福利方案下开启缴纳的福利项 + List insuranceIdList = siArchivesBiz.payInsuranceIds(item.getOtherSchemeId()); + otherJson.forEach((k, v) -> { + if (insuranceIdList.contains(Long.valueOf(k))) { + record.put(k + "otherBase", v); + } + }); + } } } @@ -628,58 +731,127 @@ public class SIExportServiceImpl extends Service implements SIExportService { } private Map> buildPaymentTitle(List pos, Map categoryIdNameMap) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); Set socailIds = new HashSet<>(); Set fundIds = new HashSet<>(); Set otherIds = new HashSet<>(); + + Set socailComIds = new HashSet<>(); + Set fundComIds = new HashSet<>(); + Set otherComIds = new HashSet<>(); + Map> result = new HashMap<>(); pos.stream().forEach(item -> { - if (StringUtils.isNotBlank(item.getSocialPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getSocialPaymentBaseString()) || StringUtils.isNotBlank(item.getSocialPaymentComBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); if (socialJson != null) { socialJson.forEach((k, v) -> { socailIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map socialComJson = JSON.parseObject(item.getSocialPaymentComBaseString(), new TypeReference>() { + }); + if (socialComJson != null) { + socialComJson.forEach((k, v) -> socailComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getFundPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getFundPaymentBaseString()) || StringUtils.isNotBlank(item.getFundPaymentComBaseString())) { Map fundJson = JSON.parseObject(item.getFundPaymentBaseString(), new HashMap().getClass()); if (fundJson != null) { fundJson.forEach((k, v) -> { fundIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map fundComJson = JSON.parseObject(item.getFundPaymentComBaseString(), new TypeReference>() { + }); + if (fundComJson != null) { + fundComJson.forEach((k, v) -> fundComIds.add(k)); + } + } } - if (StringUtils.isNotBlank(item.getOtherPaymentBaseString())) { + if (StringUtils.isNotBlank(item.getOtherPaymentBaseString()) || StringUtils.isNotBlank(item.getOtherPaymentComBaseString())) { Map otherJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); if (otherJson != null) { otherJson.forEach((k, v) -> { otherIds.add(k); }); } + //如果需要区分个人和公司福利基数 + if (welBaseDiffSign) { + Map otherComJson = JSON.parseObject(item.getOtherPaymentComBaseString(), new TypeReference>() { + }); + if (otherComJson != null) { + otherComJson.forEach((k, v) -> otherComIds.add(k)); + } + } } }); Map socialColumns = new HashMap<>(); Map fundColumns = new HashMap<>(); Map otherColumns = new HashMap<>(); - socailIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "socialBase"); - } - }); - fundIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "fundBase"); - } - }); - otherIds.stream().forEach(social -> { - if (categoryIdNameMap.containsKey(social)) { - otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(100293, "申报基数"), social + "otherBase"); - } - }); + + Map socialComColumns = new HashMap<>(); + Map fundComColumns = new HashMap<>(); + Map otherComColumns = new HashMap<>(); + + if (welBaseDiffSign) { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "socialPerBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "fundPerBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "个人"), social + "otherPerBase"); + } + }); + + socailComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "socialComBase"); + } + }); + fundComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "fundComBase"); + } + }); + otherComIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherComColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数") + SalaryI18nUtil.getI18nLabel( 0, "单位"), social + "otherComBase"); + } + }); + } else { + socailIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + socialColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel(0, "申报基数"), social + "socialBase"); + } + }); + fundIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + fundColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数"), social + "fundBase"); + } + }); + otherIds.stream().forEach(social -> { + if (categoryIdNameMap.containsKey(social)) { + otherColumns.put(categoryIdNameMap.get(social) + SalaryI18nUtil.getI18nLabel( 0, "申报基数"), social + "otherBase"); + } + }); + } // map根据value排序 LinkedHashMap socialColumnsWithAscValue = socialColumns.entrySet().stream() .sorted(Map.Entry.comparingByValue()) @@ -694,6 +866,24 @@ public class SIExportServiceImpl extends Service implements SIExportService { .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new)); + if (welBaseDiffSign) { + LinkedHashMap socialComMapWithAscKey = socialComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap fundComMapWithAscKey = fundComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + LinkedHashMap otherComMapWithAscKey = otherComColumns.entrySet().stream() + .sorted(Map.Entry.comparingByKey()) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, + LinkedHashMap::new)); + socialColumnsWithAscValue.putAll(socialComMapWithAscKey); + fundColumnsWithAscValue.putAll(fundComMapWithAscKey); + otherColumnsWithAscValue.putAll(otherComMapWithAscKey); + } + result.put(WelfareTypeEnum.SOCIAL_SECURITY.getValue(), socialColumnsWithAscValue); result.put(WelfareTypeEnum.ACCUMULATION_FUND.getValue(), fundColumnsWithAscValue); result.put(WelfareTypeEnum.OTHER.getValue(), otherColumnsWithAscValue); diff --git a/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java b/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java index e1cf27275..e9a446dac 100644 --- a/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIRecessionServiceImpl.java @@ -197,6 +197,9 @@ public class SIRecessionServiceImpl extends Service implements SIRecessionServic // temp.setExternalFlag(insuranceAccountDetailPO.getExternalFlag()); temp.setPaymentOrganization(insuranceAccountDetailPO.getPaymentOrganization()); // temp.setPaymentAgency(insuranceAccountDetailPO.getPaymentAgency()); + temp.setSocialPaymentComBaseString(insuranceAccountDetailPO.getSocialPaymentComBaseString()); + temp.setFundPaymentComBaseString(insuranceAccountDetailPO.getFundPaymentComBaseString()); + temp.setOtherPaymentComBaseString(insuranceAccountDetailPO.getOtherPaymentComBaseString()); } private void recessionSocial(RecessionParam param, InsuranceAccountDetailPO temp, InsuranceAccountDetailPO insuranceAccountDetailPO) { //退差社保个人缴费 diff --git a/src/com/engine/salary/web/SIAccountController.java b/src/com/engine/salary/web/SIAccountController.java index 75ad6975a..ab9a41c9c 100644 --- a/src/com/engine/salary/web/SIAccountController.java +++ b/src/com/engine/salary/web/SIAccountController.java @@ -2,6 +2,7 @@ package com.engine.salary.web; import com.engine.common.util.ParamUtil; import com.engine.common.util.ServiceUtil; +import com.engine.salary.common.SalaryContext; import com.engine.salary.entity.hrm.dto.HrmInfoDTO; import com.engine.salary.entity.hrm.param.HrmQueryParam; import com.engine.salary.entity.siaccount.dto.InsuranceAccountTabDTO; @@ -37,11 +38,9 @@ import javax.ws.rs.core.StreamingOutput; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.time.LocalDate; -import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * 福利核算控制器 @@ -50,6 +49,7 @@ import java.util.stream.Collectors; public class SIAccountController { public SIAccountService getService(User user) { + SalaryContext.get().setValue("user",user); return ServiceUtil.getService(SIAccountServiceImpl.class, user); } From 9d0d7a00fcf99f89b98f6dd8e29862107d60cb2c Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 8 Dec 2023 18:06:54 +0800 Subject: [PATCH 07/12] =?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=88=97=E8=A1=A8=E3=80=81=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E3=80=81=E5=AF=BC=E5=87=BA=EF=BC=8C=E9=80=82=E9=85=8D=E6=8B=86?= =?UTF-8?q?=E5=88=86=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E5=92=8C=E5=85=AC=E5=8F=B8=E5=9F=BA=E6=95=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bo/InsuranceComparisonResultBO.java | 6 - .../param/ExcelInsuranceImportParam.java | 3 +- .../siaccount/ExcelInsuranceDetailMapper.xml | 24 +- .../impl/SIAComparisonResultServiceImpl.java | 46 +- .../service/impl/SIAccountServiceImpl.java | 557 ++++++++++++++---- 5 files changed, 479 insertions(+), 157 deletions(-) diff --git a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java index 79909c1e2..c6e6b40a3 100644 --- a/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java +++ b/src/com/engine/salary/entity/siaccount/bo/InsuranceComparisonResultBO.java @@ -242,12 +242,6 @@ public class InsuranceComparisonResultBO { //其他福利基数,otherPaymentBaseString welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3); } - //社保基数,socialPaymentBaseString - welfareElementCompare(map, accountExportPO.getSocialPaymentBaseString(), excelAccountExportPO.getSocialPaymentBaseString(), "Base", 1); - //公积金基数,fundPaymentBaseString - welfareElementCompare(map, accountExportPO.getFundPaymentBaseString(), excelAccountExportPO.getFundPaymentBaseString(), "Base", 2); - //其他福利基数,otherPaymentBaseString - welfareElementCompare(map, accountExportPO.getOtherPaymentBaseString(), excelAccountExportPO.getOtherPaymentBaseString(), "Base", 3); //社保个人socialPerJson welfareElementCompare(map, accountExportPO.getSocialPerJson(), excelAccountExportPO.getSocialPerJson(), "Per", 1); //公积金个人fundPerJson diff --git a/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java b/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java index 17b926b08..7a9090845 100644 --- a/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java +++ b/src/com/engine/salary/entity/siaccount/param/ExcelInsuranceImportParam.java @@ -25,5 +25,6 @@ public class ExcelInsuranceImportParam { /** * 账单月份 */ - private String billMonth; + private String billMonth; + private String paymentOrganization; } diff --git a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml index d45fdec16..15ac635ce 100644 --- a/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml +++ b/src/com/engine/salary/mapper/siaccount/ExcelInsuranceDetailMapper.xml @@ -157,7 +157,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( @@ -204,7 +205,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) @@ -213,7 +217,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) select #{item.id,jdbcType=DOUBLE}, @@ -259,7 +264,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey,jdbcType=VARCHAR}, - #{item.paymentOrganization,jdbcType=DOUBLE} + #{item.paymentOrganization,jdbcType=DOUBLE}, + #{item.socialPaymentComBaseString,jdbcType=VARCHAR}, + #{item.fundPaymentComBaseString,jdbcType=VARCHAR}, + #{item.otherPaymentComBaseString,jdbcType=VARCHAR} from dual @@ -269,7 +277,8 @@ (id,employee_id,bill_month,bill_status,payment_status,supplementary_month,supplementary_projects,resource_from,social_pay_org,social_account,social_scheme_id,social_payment_base_string, fund_pay_org,fund_account,supplement_fund_account,fund_scheme_id,fund_payment_base_string,other_pay_org,other_scheme_id,other_payment_base_string,social_per_json, social_per_sum,fund_per_json,fund_per_sum,other_per_json,other_per_sum,per_sum,social_com_json,social_com_sum,fund_com_json,fund_com_sum,other_com_json,other_com_sum, - com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization) + com_sum,social_sum,fund_sum,other_sum,total,creator,create_time,update_time,delete_type,tenant_key,payment_organization, + social_payment_com_base_string,fund_payment_com_base_string,other_payment_com_base_string) VALUES ( #{item.id}, @@ -315,7 +324,10 @@ #{item.updateTime}, #{item.deleteType}, #{item.tenantKey}, - #{item.paymentOrganization} + #{item.paymentOrganization}, + #{item.socialPaymentComBaseString}, + #{item.fundPaymentComBaseString}, + #{item.otherPaymentComBaseString} ) diff --git a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java index 23587a874..389e4ef2b 100644 --- a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java @@ -25,6 +25,7 @@ import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.excel.ExcelUtil; +import com.engine.salary.util.excel.ExcelUtilPlus; import com.engine.salary.util.page.Column; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -134,7 +135,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar String sheetName = "线下对比结果"; - return ExcelUtil.genWorkbookV2(rows, sheetName); + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); } @@ -231,7 +232,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar } private Set welfareInfo() { - + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); Set info = new HashSet<>(); List listAll = getICategoryMapper().listAll(); @@ -239,18 +240,37 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar List fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2).collect(Collectors.toList()); List otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3).collect(Collectors.toList()); - //组装社保基数 - for (ICategoryPO po : socialWelfareList) { - info.add(po.getId() + "socialBase"); - } - //组装公积金基数 - for (ICategoryPO po : fundWelfareList) { - info.add(po.getId() + "fundBase"); - } - //组装其他福利基数 - for (ICategoryPO po : otherWelfareList) { - info.add(po.getId() + "otherBase"); + if (welBaseDiffSign) { + //组装社保基数 + for (ICategoryPO po : socialWelfareList) { + info.add(po.getId() + "socialPerBase"); + info.add(po.getId() + "socialComBase"); + } + //组装公积金基数 + for (ICategoryPO po : fundWelfareList) { + info.add(po.getId() + "fundPerBase"); + info.add(po.getId() + "fundComBase"); + } + //组装其他福利基数 + for (ICategoryPO po : otherWelfareList) { + info.add(po.getId() + "otherPerBase"); + info.add(po.getId() + "otherComBase"); + } + } else { + //组装社保基数 + for (ICategoryPO po : socialWelfareList) { + info.add(po.getId() + "socialBase"); + } + //组装公积金基数 + for (ICategoryPO po : fundWelfareList) { + info.add(po.getId() + "fundBase"); + } + //组装其他福利基数 + for (ICategoryPO po : otherWelfareList) { + info.add(po.getId() + "otherBase"); + } } + //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelfareList) { info.add(po.getId() + "socialPer"); diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index d9387e62c..1385b84d7 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -2222,6 +2222,78 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { */ @Override public XSSFWorkbook exportComparisonWelfareTemplate(InsuranceAccountDetailParam param) { + Map> welColumnMap = createWelColumnMap(param); + + List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), + SalaryI18nUtil.getI18nLabel(86185, "部门"), + SalaryI18nUtil.getI18nLabel(86186, "手机号"), + SalaryI18nUtil.getI18nLabel(86317, "工号"), + SalaryI18nUtil.getI18nLabel(86187, "员工状态"), + SalaryI18nUtil.getI18nLabel(100377, "数据来源"), + SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人")); + headerList.add(SalaryI18nUtil.getI18nLabel(91324, "社保账号")); + headerList.add(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")); + //组装社保基数 + if (welColumnMap.get("socialBase") != null) { + headerList.addAll(welColumnMap.get("socialBase")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(91486, "公积金账号")); + headerList.add(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")); + //组装公积金基数 + if (welColumnMap.get("fundBase") != null) { + headerList.addAll(welColumnMap.get("fundBase")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")); + headerList.add(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")); + //组装其他福利基数 + if (welColumnMap.get("otherBase") != null) { + headerList.addAll(welColumnMap.get("otherBase")); + } + //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) + if (welColumnMap.get("socialPer") != null) { + headerList.addAll(welColumnMap.get("socialPer")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100388, "社保个人合计")); + //住房公积金个人、补充住房公积金个人 + if (welColumnMap.get("fundPer") != null) { + headerList.addAll(welColumnMap.get("fundPer")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100390, "公积金个人合计")); + //其他个人(比如企业年金个人) + if (welColumnMap.get("otherPer") != null) { + headerList.addAll(welColumnMap.get("otherPer")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100392, "其他福利个人合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100393, "个人合计")); + //社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位) + if (welColumnMap.get("socialCom") != null) { + headerList.addAll(welColumnMap.get("socialCom")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100394, "社保单位合计")); + //住房公积金单位、补充住房公积金单位 + if (welColumnMap.get("fundCom") != null) { + headerList.addAll(welColumnMap.get("fundCom")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100395, "公积金单位合计")); + //其他单位(比如企业年金单位) + if (welColumnMap.get("otherCom") != null) { + headerList.addAll(welColumnMap.get("otherCom")); + } + headerList.add(SalaryI18nUtil.getI18nLabel(100396, "其他福利单位合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100397, "单位合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100398, "社保合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100399, "公积金合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(100400, "其他福利合计")); + headerList.add(SalaryI18nUtil.getI18nLabel(93278, "合计")); + + List> rows = new ArrayList<>(); + rows.add(headerList); + String sheetName = "福利核算-线下对比导入模板"; + + return ExcelUtilPlus.genWorkbookV2(rows, sheetName); + } + + public Map> createWelColumnMap(InsuranceAccountDetailParam param) { boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); //查询线上福利核算记录 InsuranceExportParam insuranceExportParam = new InsuranceExportParam(); @@ -2266,114 +2338,238 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { List fundWelComList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); List otherWelComList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); - List headerList = Lists.newArrayList(SalaryI18nUtil.getI18nLabel(85429, "姓名"), - SalaryI18nUtil.getI18nLabel(86185, "部门"), - SalaryI18nUtil.getI18nLabel(86186, "手机号"), - SalaryI18nUtil.getI18nLabel(86317, "工号"), - SalaryI18nUtil.getI18nLabel(86187, "员工状态"), - SalaryI18nUtil.getI18nLabel(100377, "数据来源"), - SalaryI18nUtil.getI18nLabel(91325, "个税扣缴义务人")); - headerList.add(SalaryI18nUtil.getI18nLabel(91324, "社保账号")); - headerList.add(SalaryI18nUtil.getI18nLabel(91323, "社保方案名称")); -// "失业保险申报基数" -// "生育保险申报基数" -// "养老保险申报基数" -// "医疗保险申报基数" -// "工伤保险申报基数" -// for (ICategoryPO po : socialWelfareList) { -// headerList.add(po.getInsuranceName() + "申报基数"); -// } //组装社保基数 + List socialBaseColumns = new ArrayList<>(); + List socialPerBaseColumns = new ArrayList<>(); + List socialComBaseColumns = Lists.newArrayList(); if (welBaseDiffSign) { - List socialComColumns = Lists.newArrayList(); for (ICategoryPO po : socialWelfareList) { - headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); - socialComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + socialPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + socialComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); } - headerList.addAll(socialComColumns); + socialBaseColumns.addAll(socialPerBaseColumns); + socialBaseColumns.addAll(socialComBaseColumns); } else { for (ICategoryPO po : socialWelfareList) { - headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + socialBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); } } - headerList.add(SalaryI18nUtil.getI18nLabel(91486, "公积金账号")); - headerList.add(SalaryI18nUtil.getI18nLabel(91485, "公积金方案名称")); + //组装公积金基数 -// for (ICategoryPO po : fundWelfareList) { -// headerList.add(po.getInsuranceName() + "申报基数"); -// } + List fundBaseColumns = new ArrayList<>(); + List fundPerBaseColumns = Lists.newArrayList(); + List fundComBaseColumns = Lists.newArrayList(); if (welBaseDiffSign) { - List fundComColumns = Lists.newArrayList(); for (ICategoryPO po : fundWelfareList) { - headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); - fundComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + fundPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + fundComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); } - headerList.addAll(fundComColumns); + fundBaseColumns.addAll(fundPerBaseColumns); + fundBaseColumns.addAll(fundComBaseColumns); } else { for (ICategoryPO po : fundWelfareList) { - headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + fundBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); } } - headerList.add(SalaryI18nUtil.getI18nLabel(91487, "补充公积金账号")); - headerList.add(SalaryI18nUtil.getI18nLabel(91496, "其他福利方案名称")); + //组装其他福利基数 -// for (ICategoryPO po : otherWelfareList) { -// headerList.add(po.getInsuranceName() + "申报基数"); -// } + List otherBaseColumns = new ArrayList<>(); + List otherPerBaseColumns = new ArrayList<>(); + List otherComBaseColumns = Lists.newArrayList(); if (welBaseDiffSign) { - List otherComColumns = Lists.newArrayList(); for (ICategoryPO po : otherWelfareList) { - headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); - otherComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); + otherPerBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"个人")); + otherComBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数") + SalaryI18nUtil.getI18nLabel(0,"单位")); } - headerList.addAll(otherComColumns); + otherBaseColumns.addAll(otherPerBaseColumns); + otherBaseColumns.addAll(otherComBaseColumns); } else { for (ICategoryPO po : otherWelfareList) { - headerList.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); + otherBaseColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0, "申报基数")); } } + + //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) + List socialPerColumns = new ArrayList<>(); + for (ICategoryPO po : socialWelPerList) { + socialPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + //住房公积金个人、补充住房公积金个人 + List fundPerColumns = new ArrayList<>(); + for (ICategoryPO po : fundWelPerList) { + fundPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + //其他个人(比如企业年金个人) + List otherPerColumns = new ArrayList<>(); + for (ICategoryPO po : otherWelPerList) { + otherPerColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"个人")); + } + //社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位) + List socialComColumns = new ArrayList<>(); + for (ICategoryPO po : socialWelComList) { + socialComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + //住房公积金单位、补充住房公积金单位 + List fundComColumns = new ArrayList<>(); + for (ICategoryPO po : fundWelComList) { + fundComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + + //其他单位(比如企业年金单位) + List otherComColumns = new ArrayList<>(); + for (ICategoryPO po : otherWelComList) { + otherComColumns.add(po.getInsuranceName() + SalaryI18nUtil.getI18nLabel(0,"单位")); + } + + Map> welColumnMap = new HashMap<>(); + welColumnMap.put("socialPerBase", socialPerBaseColumns); + welColumnMap.put("fundPerBase", fundPerBaseColumns); + welColumnMap.put("otherPerBase", otherPerBaseColumns); + welColumnMap.put("socialComBase", socialComBaseColumns); + welColumnMap.put("fundComBase", fundComBaseColumns); + welColumnMap.put("otherComBase", otherComBaseColumns); + welColumnMap.put("socialBase", socialBaseColumns); + welColumnMap.put("fundBase", fundBaseColumns); + welColumnMap.put("otherBase", otherBaseColumns); + welColumnMap.put("socialPer", socialPerColumns); + welColumnMap.put("fundPer", fundPerColumns); + welColumnMap.put("otherPer", otherPerColumns); + welColumnMap.put("socialCom", socialComColumns); + welColumnMap.put("fundCom", fundComColumns); + welColumnMap.put("otherCom", otherComColumns); + return welColumnMap; + } + + public Map welColumnNameCodeMap(InsuranceAccountDetailParam param) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); + //查询线上福利核算记录 + InsuranceExportParam insuranceExportParam = new InsuranceExportParam(); + insuranceExportParam.setBillMonth(param.getBillMonth()); + insuranceExportParam.setPaymentOrganization(param.getPaymentOrganization()); + List accountExportPOS = getInsuranceExportMapper().exportAccount(param.getPaymentStatus(), insuranceExportParam); + + //整理线上核算记录相关的福利方案,并以此整理需要对比的福利项类别数据 + Set welfareSchemeIds = new HashSet<>(); + accountExportPOS.forEach(f -> { + welfareSchemeIds.add(f.getSocialSchemeId()); + welfareSchemeIds.add(f.getFundSchemeId()); + welfareSchemeIds.add(f.getOtherSchemeId()); + }); + List insuranceSchemeDetailPos = getInsuranceSchemeDetailMapper().listAll(); + List insuranceBaseIds = insuranceSchemeDetailPos.stream() + .filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1) + .map(InsuranceSchemeDetailPO::getInsuranceId) + .collect(Collectors.toList()); + List insurancePerPayIds = insuranceSchemeDetailPos.stream() + .filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1 && f.getPaymentScope() == 2) + .map(InsuranceSchemeDetailPO::getInsuranceId) + .collect(Collectors.toList()); + List insuranceComPayIds = insuranceSchemeDetailPos.stream() + .filter(f -> welfareSchemeIds.contains(f.getPrimaryId()) && f.getIsPayment() == 1 && f.getPaymentScope() == 1) + .map(InsuranceSchemeDetailPO::getInsuranceId) + .collect(Collectors.toList()); + Set insuranceBaseSet = new HashSet<>(insuranceBaseIds); + Set insurancePerPaySet = new HashSet<>(insurancePerPayIds); + Set insuranceComPaySet = new HashSet<>(insuranceComPayIds); + + List listAll = getICategoryMapper().listAll(); + List socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); + List fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); + List otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceBaseSet.contains(e.getId())).collect(Collectors.toList()); + + List socialWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList()); + List fundWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList()); + List otherWelPerList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insurancePerPaySet.contains(e.getId())).collect(Collectors.toList()); + + List socialWelComList = listAll.stream().filter(e -> e.getWelfareType() == 1 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); + List fundWelComList = listAll.stream().filter(e -> e.getWelfareType() == 2 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); + List otherWelComList = listAll.stream().filter(e -> e.getWelfareType() == 3 && e.getIsUse() == 1 && insuranceComPaySet.contains(e.getId())).collect(Collectors.toList()); + + //组装社保基数 + Map result = new HashMap<>(); + if (welBaseDiffSign) { + for (ICategoryPO po : socialWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"个人"), po.getId() + "socialPerBase"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"单位"), po.getId() + "socialComBase"); + } + } else { + for (ICategoryPO po : socialWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "socialBase"); + } + } + + //组装公积金基数 + if (welBaseDiffSign) { + for (ICategoryPO po : fundWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"个人"), po.getId() + "fundPerBase"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"单位"), po.getId() + "fundComBase"); + } + } else { + for (ICategoryPO po : fundWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "fundBase"); + } + } + + //组装其他福利基数 + if (welBaseDiffSign) { + for (ICategoryPO po : otherWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"个人"), po.getId() + "otherPerBase"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数") + + SalaryI18nUtil.getI18nLabel(0,"单位"), po.getId() + "otherComBase"); + } + } else { + for (ICategoryPO po : otherWelfareList) { + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "otherBase"); + } + } + //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelPerList) { - headerList.add(po.getInsuranceName() + "个人"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "socialPer"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100388, "社保个人合计")); //住房公积金个人、补充住房公积金个人 for (ICategoryPO po : fundWelPerList) { - headerList.add(po.getInsuranceName() + "个人"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "fundPer"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100390, "公积金个人合计")); //其他个人(比如企业年金个人) for (ICategoryPO po : otherWelPerList) { - headerList.add(po.getInsuranceName() + "个人"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "otherPer"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100392, "其他福利个人合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(100393, "个人合计")); //社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位) for (ICategoryPO po : socialWelComList) { - headerList.add(po.getInsuranceName() + "单位"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "socialCom"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100394, "社保单位合计")); //住房公积金单位、补充住房公积金单位 for (ICategoryPO po : fundWelComList) { - headerList.add(po.getInsuranceName() + "单位"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "fundCom"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100395, "公积金单位合计")); + //其他单位(比如企业年金单位) for (ICategoryPO po : otherWelComList) { - headerList.add(po.getInsuranceName() + "单位"); + result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) + + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "otherCom"); } - headerList.add(SalaryI18nUtil.getI18nLabel(100396, "其他福利单位合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(100397, "单位合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(100398, "社保合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(100399, "公积金合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(100400, "其他福利合计")); - headerList.add(SalaryI18nUtil.getI18nLabel(93278, "合计")); - List> rows = new ArrayList<>(); - rows.add(headerList); - String sheetName = "福利核算-线下对比导入模板"; - - return ExcelUtilPlus.genWorkbookV2(rows, sheetName); + return result; } /** @@ -2424,6 +2620,12 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } String billMonth = importParam.getBillMonth(); + + Map welColumnNameCodeMap = welColumnNameCodeMap(InsuranceAccountDetailParam.builder() + .billMonth(billMonth) + .paymentOrganization(importParam.getPaymentOrganization()) + .paymentStatus(PaymentStatusEnum.COMMON.getValue()) + .build()); //存储待更新的InsuranceAccountDetailPO数据 List addCompareList = new ArrayList<>(); //记录待删除hrsa_excel_bill_detail.id @@ -2518,7 +2720,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { idList.addAll(ids); } //拼装待更新数据 - addCompareList.add(handleExcelInsuranceDetail(billMonth, employeeId, paymentOrganization, map)); + addCompareList.add(handleExcelInsuranceDetail(billMonth, employeeId, paymentOrganization, map, welColumnNameCodeMap)); } @@ -2557,7 +2759,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { * @param billMonth 对比的账单月份 * @param baseMap excel导入的对比数据 */ - private ExcelInsuranceDetailPO handleExcelInsuranceDetail(String billMonth, Long employeeId, Long paymentOrganization, Map baseMap) { + private ExcelInsuranceDetailPO handleExcelInsuranceDetail(String billMonth, Long employeeId, Long paymentOrganization, Map baseMap, Map welColumnNameCodeMap) { + boolean welBaseDiffSign = siArchivesBiz.isDiffWelBase(); ExcelInsuranceDetailPO excelInsuranceDetailPO = new ExcelInsuranceDetailPO(); excelInsuranceDetailPO.setId(IdGenerator.generate()); @@ -2573,6 +2776,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { Map fundPaymentBaseMap = new HashMap<>(); Map otherPaymentBaseMap = new HashMap<>(); + Map socialPaymentComBaseMap = new HashMap<>(); + Map fundPaymentComBaseMap = new HashMap<>(); + Map otherPaymentComBaseMap = new HashMap<>(); + //筛选出福利核算项 Map toDealMap = baseMap.entrySet().stream() @@ -2586,73 +2793,157 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); for(Map.Entry entry : toDealMap.entrySet()) { - //判断元素是否属于福利类 - String keyName = entry.getKey(); - //获取元素名后缀,方便之后判断“个人”或“单位”或者“基数” - String payScope = keyName.substring(keyName.length() - 2); - //获取福利类型 - Integer welfareType; - //根据元素名后缀,区分截取内容 - String targetWelfareName; - if ("基数".equals(payScope)) { - targetWelfareName = entry.getKey().substring(0, keyName.length() - 4); - } else { - targetWelfareName = entry.getKey().substring(0, keyName.length() - 2); - } - List categoryPOList = siCategoryBiz.listByName(targetWelfareName); - if (categoryPOList.size() == 1) { - ICategoryPO iCategoryPO = categoryPOList.get(0); - welfareType = iCategoryPO.getWelfareType(); +// //判断元素是否属于福利类 +// String keyName = entry.getKey(); +// //获取元素名后缀,方便之后判断“个人”或“单位”或者“基数” +// String payScope = keyName.substring(keyName.length() - 2); +// //获取福利类型 +// Integer welfareType; +// //根据元素名后缀,区分截取内容 +// String targetWelfareName; +// if ("基数".equals(payScope)) { +// targetWelfareName = entry.getKey().substring(0, keyName.length() - 4); +// } else { +// targetWelfareName = entry.getKey().substring(0, keyName.length() - 2); +// } +// List categoryPOList = siCategoryBiz.listByName(targetWelfareName); +// if (categoryPOList.size() == 1) { +// ICategoryPO iCategoryPO = categoryPOList.get(0); +// welfareType = iCategoryPO.getWelfareType(); +// +// switch (payScope) { +// case "个人": +// switch (welfareType) { +// case 1: +// socialPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 2: +// fundPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 3: +// otherPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// default: +// throw new SalaryRunTimeException("福利类型不存在"); +// } +// break; +// case "单位": +// switch (welfareType) { +// case 1: +// socialComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 2: +// fundComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 3: +// otherComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// default: +// throw new SalaryRunTimeException("福利类型不存在"); +// } +// break; +// case "基数": +// switch (welfareType) { +// case 1: +// socialPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 2: +// fundPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// case 3: +// otherPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); +// break; +// default: +// throw new SalaryRunTimeException("福利类型不存在"); +// } +// break; +// } +// } - switch (payScope) { - case "个人": - switch (welfareType) { - case 1: - socialPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 3: - otherPerMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException("福利类型不存在"); - } - break; - case "单位": - switch (welfareType) { - case 1: - socialComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 3: - otherComMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException("福利类型不存在"); - } - break; - case "基数": - switch (welfareType) { - case 1: - socialPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 3: - otherPaymentBaseMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException("福利类型不存在"); - } - break; + if (welColumnNameCodeMap.get(entry.getKey()) != null) { + String code = welColumnNameCodeMap.get(entry.getKey()); + if (welBaseDiffSign) { + if (code.contains("socialPerBase")) { + code = code.replace("socialPerBase", ""); + socialPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("socialComBase")) { + code = code.replace("socialComBase", ""); + socialPaymentComBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundPerBase")) { + code = code.replace("fundPerBase", ""); + fundPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundComBase")) { + code = code.replace("fundComBase", ""); + fundPaymentComBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherPerBase")) { + code = code.replace("otherPerBase", ""); + otherPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherComBase")) { + code = code.replace("otherComBase", ""); + otherPaymentComBaseMap.put(code, entry.getValue().toString()); + continue; + } + } else { + if (code.contains("socialBase")) { + code = code.replace("socialBase", ""); + socialPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundBase")) { + code = code.replace("fundBase", ""); + fundPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherBase")) { + code = code.replace("otherBase", ""); + otherPaymentBaseMap.put(code, entry.getValue().toString()); + continue; + } + } + + + if (code.contains("socialPer") && !code.contains("socialPerBase")) { + code = code.replace("socialPer", ""); + socialPerMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundPer") && !code.contains("fundPerBase")) { + code = code.replace("fundPer", ""); + fundPerMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherPer") && !code.contains("otherPerBase")) { + code = code.replace("otherPer", ""); + otherPerMap.put(code, entry.getValue().toString()); + continue; + } + + if (code.contains("socialCom") && !code.contains("socialComBase")) { + code = code.replace("socialCom", ""); + socialComMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("fundCom") && !code.contains("fundComBase")) { + code = code.replace("fundCom", ""); + fundComMap.put(code, entry.getValue().toString()); + continue; + } + if (code.contains("otherCom") && !code.contains("otherComBase")) { + code = code.replace("otherCom", ""); + otherComMap.put(code, entry.getValue().toString()); + continue; } } - } //设置社保个人和公司缴纳明细 @@ -2669,6 +2960,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { excelInsuranceDetailPO.setFundPaymentBaseString(JSON.toJSONString(fundPaymentBaseMap)); excelInsuranceDetailPO.setOtherPaymentBaseString(JSON.toJSONString(otherPaymentBaseMap)); + excelInsuranceDetailPO.setSocialPaymentComBaseString(JSON.toJSONString(socialPaymentComBaseMap)); + excelInsuranceDetailPO.setFundPaymentComBaseString(JSON.toJSONString(fundPaymentComBaseMap)); + excelInsuranceDetailPO.setOtherPaymentComBaseString(JSON.toJSONString(otherPaymentComBaseMap)); + //组装新的insuranceAccountDetailPO对象数据 excelInsuranceDetailPO.setEmployeeId(employeeId); excelInsuranceDetailPO.setBillMonth(billMonth); From e97dab27fc162809bac36042006d229ca231b5ff Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 13 Dec 2023 10:51:24 +0800 Subject: [PATCH 08/12] =?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=E6=8B=86=E5=88=86?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E5=9F=BA=E6=95=B0=E9=80=BB=E8=BE=91=E7=9B=B8=E5=85=B3sql?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202312130203.sql | 39 +++++++++++++++++++ resource/sqlupgrade/GS/sql202312130203.sql | 39 +++++++++++++++++++ resource/sqlupgrade/JC/sql202312130203.sql | 39 +++++++++++++++++++ resource/sqlupgrade/Mysql/sql202312130203.sql | 17 ++++++++ .../sqlupgrade/Oracle/sql202312130203.sql | 30 ++++++++++++++ resource/sqlupgrade/PG/sql202312130203.sql | 17 ++++++++ .../sqlupgrade/SQLServer/sql202312130203.sql | 30 ++++++++++++++ resource/sqlupgrade/ST/sql202312130203.sql | 39 +++++++++++++++++++ 8 files changed, 250 insertions(+) create mode 100644 resource/sqlupgrade/DM/sql202312130203.sql create mode 100644 resource/sqlupgrade/GS/sql202312130203.sql create mode 100644 resource/sqlupgrade/JC/sql202312130203.sql create mode 100644 resource/sqlupgrade/Mysql/sql202312130203.sql create mode 100644 resource/sqlupgrade/Oracle/sql202312130203.sql create mode 100644 resource/sqlupgrade/PG/sql202312130203.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202312130203.sql create mode 100644 resource/sqlupgrade/ST/sql202312130203.sql diff --git a/resource/sqlupgrade/DM/sql202312130203.sql b/resource/sqlupgrade/DM/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/GS/sql202312130203.sql b/resource/sqlupgrade/GS/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/JC/sql202312130203.sql b/resource/sqlupgrade/JC/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + diff --git a/resource/sqlupgrade/Mysql/sql202312130203.sql b/resource/sqlupgrade/Mysql/sql202312130203.sql new file mode 100644 index 000000000..7ff70da9f --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202312130203.sql @@ -0,0 +1,17 @@ +ALTER TABLE hrsa_social_archives ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_fund_archives ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_other_archives ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_insurance_base_history ADD COLUMN payment_scope varchar(10) NULL; diff --git a/resource/sqlupgrade/Oracle/sql202312130203.sql b/resource/sqlupgrade/Oracle/sql202312130203.sql new file mode 100644 index 000000000..f62d861b8 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202312130203.sql @@ -0,0 +1,30 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL +/ +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202312130203.sql b/resource/sqlupgrade/PG/sql202312130203.sql new file mode 100644 index 000000000..9b9630ce6 --- /dev/null +++ b/resource/sqlupgrade/PG/sql202312130203.sql @@ -0,0 +1,17 @@ +ALTER TABLE hrsa_social_archives ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_fund_archives ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_other_archives ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_bill_detail_temp ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN social_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN fund_payment_com_base_string varchar(4000) NULL; +ALTER TABLE hrsa_excel_bill_detail ADD COLUMN other_payment_com_base_string varchar(4000) NULL; + +ALTER TABLE hrsa_insurance_base_history ADD COLUMN payment_scope varchar(10) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202312130203.sql b/resource/sqlupgrade/SQLServer/sql202312130203.sql new file mode 100644 index 000000000..0738202b3 --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202312130203.sql @@ -0,0 +1,30 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar(4000) NULL +GO +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar(4000) NULL +GO + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar(10) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202312130203.sql b/resource/sqlupgrade/ST/sql202312130203.sql new file mode 100644 index 000000000..d5bdd577d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202312130203.sql @@ -0,0 +1,39 @@ +ALTER TABLE hrsa_social_archives ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_fund_archives ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_other_archives ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_bill_detail_temp ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD social_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD fund_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_excel_bill_detail ADD other_payment_com_base_string varchar2(4000) NULL; +/ + +ALTER TABLE hrsa_insurance_base_history ADD payment_scope varchar2(10) NULL; +/ + From 2685c724e4408337958de4dc7b64a58aaf492798 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 14 Dec 2023 13:59:39 +0800 Subject: [PATCH 09/12] =?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=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E7=BC=96=E8=BE=91=E9=A1=B5=E6=96=B9=E6=A1=88?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E8=BF=94=E5=9B=9E=E9=80=BB?= =?UTF-8?q?=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 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index 32186cbbb..f2f3feee7 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -317,6 +317,12 @@ public class SIArchivesBiz { List inputItems = buildPaymentBase(user, schemeId, welfareType); addGroups.add(new SearchConditionGroup("其它福利缴纳基数", true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("其它福利缴纳基数", true, inputComItems)); + dataMap.put("comItems", addComGroups); + } return dataMap; } @@ -344,6 +350,12 @@ public class SIArchivesBiz { List inputItems = buildPaymentBase(user, schemeId, welfareType); addGroups.add(new SearchConditionGroup("公积金缴纳基数", true, inputItems)); dataMap.put("items", addGroups); + if (welBaseDiffSign) { + List addComGroups = new ArrayList<>(); + List inputComItems = buildPaymentComBase(user, schemeId, welfareType); + addComGroups.add(new SearchConditionGroup("公积金缴纳基数", true, inputComItems)); + dataMap.put("comItems", addComGroups); + } return dataMap; } From 7cb0e686238e8e48ce887a84e32d7c5fe9298939 Mon Sep 17 00:00:00 2001 From: sy Date: Fri, 15 Dec 2023 09:50:20 +0800 Subject: [PATCH 10/12] =?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=E7=A6=8F=E5=88=A9?= =?UTF-8?q?=E6=A1=A3=E6=A1=88=E7=BC=96=E8=BE=91=E9=A1=B5=E5=85=AC=E5=8F=B8?= =?UTF-8?q?=E5=9F=BA=E6=95=B0=E4=BF=A1=E6=81=AF=E8=BF=94=E5=9B=9E=E9=80=BB?= =?UTF-8?q?=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/entity/siarchives/bo/InsuranceArchivesBO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java index a96b96aad..710038513 100644 --- a/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java +++ b/src/com/engine/salary/entity/siarchives/bo/InsuranceArchivesBO.java @@ -35,6 +35,7 @@ public class InsuranceArchivesBO { .socialStartTime(po.getSocialStartTime()) .schemeAccount(po.getSocialAccount()) .schemePaymentBaseString(po.getSocialPaymentBaseString()) + .schemePaymentComBaseString(po.getSocialPaymentComBaseString()) .underTake(po.getUnderTake() == null ? null : String.valueOf(po.getUnderTake())) .build(); } @@ -52,6 +53,7 @@ public class InsuranceArchivesBO { .fundSchemeId(po.getFundSchemeId()) .paymentOrganization(po.getPaymentOrganization()) .fundPaymentBaseString(po.getFundPaymentBaseString()) + .fundPaymentComBaseString(po.getFundPaymentComBaseString()) .fundStartTime(po.getFundStartTime()) .supplementFundAccount(po.getSupplementFundAccount()) .nonPayment(po.getNonPayment()) @@ -72,6 +74,7 @@ public class InsuranceArchivesBO { .otherName(po.getOtherSchemeId() == null ? null : String.valueOf(po.getOtherSchemeId())) .otherSchemeId(po.getOtherSchemeId()) .otherPaymentBaseString(po.getOtherPaymentBaseString()) + .otherPaymentComBaseString(po.getOtherPaymentComBaseString()) .otherStartTime(po.getOtherStartTime()) .otherEndTime(po.getOtherEndTime()) .paymentOrganization(po.getPaymentOrganization()) From a5eb86ab068b7f5f36305be0e1a6e9eaad7f1303 Mon Sep 17 00:00:00 2001 From: sy Date: Thu, 21 Dec 2023 13:33:21 +0800 Subject: [PATCH 11/12] =?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=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E9=80=82=E9=85=8D=E7=A6=8F=E5=88=A9=E5=9F=BA?= =?UTF-8?q?=E6=95=B0=E4=B8=AA=E4=BA=BA=E5=92=8C=E5=85=AC=E5=8F=B8=E5=AF=BC?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SIAccountServiceImpl.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 1385b84d7..cbed96243 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -2540,33 +2540,33 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //社保个人(生育保险个人、工伤保险个人、失业保险个人、养老保险个人、医疗保险个人) for (ICategoryPO po : socialWelPerList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) - + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "socialPer"); + + SalaryI18nUtil.getI18nLabel(0, "个人"), po.getId() + "socialPer"); } //住房公积金个人、补充住房公积金个人 for (ICategoryPO po : fundWelPerList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) - + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "fundPer"); + + SalaryI18nUtil.getI18nLabel(0, "个人"), po.getId() + "fundPer"); } //其他个人(比如企业年金个人) for (ICategoryPO po : otherWelPerList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) - + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "otherPer"); + + SalaryI18nUtil.getI18nLabel(0, "个人"), po.getId() + "otherPer"); } //社保单位(生育保险单位、工伤保险单位、失业保险单位、养老保险单位、医疗保险单位) for (ICategoryPO po : socialWelComList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) - + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "socialCom"); + + SalaryI18nUtil.getI18nLabel(0, "单位"), po.getId() + "socialCom"); } //住房公积金单位、补充住房公积金单位 for (ICategoryPO po : fundWelComList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) - + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "fundCom"); + + SalaryI18nUtil.getI18nLabel(0, "单位"), po.getId() + "fundCom"); } //其他单位(比如企业年金单位) for (ICategoryPO po : otherWelComList) { result.put(Util.formatMultiLang(po.getInsuranceName(), String.valueOf(user.getLanguage())) - + SalaryI18nUtil.getI18nLabel(0, "申报基数"), po.getId() + "otherCom"); + + SalaryI18nUtil.getI18nLabel(0, "单位"), po.getId() + "otherCom"); } return result; @@ -2621,11 +2621,12 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { String billMonth = importParam.getBillMonth(); - Map welColumnNameCodeMap = welColumnNameCodeMap(InsuranceAccountDetailParam.builder() - .billMonth(billMonth) - .paymentOrganization(importParam.getPaymentOrganization()) - .paymentStatus(PaymentStatusEnum.COMMON.getValue()) - .build()); +// Map welColumnNameCodeMap = welColumnNameCodeMap(InsuranceAccountDetailParam.builder() +// .billMonth(billMonth) +// .paymentOrganization(importParam.getPaymentOrganization()) +// .paymentStatus(PaymentStatusEnum.COMMON.getValue()) +// .build()); + Map welColumnNameCodeMap = new HashMap<>(); //存储待更新的InsuranceAccountDetailPO数据 List addCompareList = new ArrayList<>(); //记录待删除hrsa_excel_bill_detail.id @@ -2647,6 +2648,11 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (taxAgentPoList.size() == 1) { paymentOrganization = taxAgentPoList.get(0).getId(); + welColumnNameCodeMap = welColumnNameCodeMap(InsuranceAccountDetailParam.builder() + .billMonth(billMonth) + .paymentOrganization(paymentOrganization.toString()) + .paymentStatus(PaymentStatusEnum.COMMON.getValue()) + .build()); } else { isError = true; Map errorMessageMap = Maps.newHashMap(); From 681c0fb18eeaadc8d4d5345503db1fc3386976c9 Mon Sep 17 00:00:00 2001 From: sy Date: Mon, 8 Jan 2024 10:57:55 +0800 Subject: [PATCH 12/12] =?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=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=B8=AD=E6=9B=B4=E6=96=B0=E6=A1=A3=E6=A1=88?= =?UTF-8?q?=E4=B8=BB=E8=A1=A8=E5=92=8C=E5=AD=90=E8=A1=A8=E7=9A=84=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=85=B3=E7=B3=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIArchivesBiz.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index f2f3feee7..977adaab4 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -705,7 +705,7 @@ public class SIArchivesBiz { /** * @param paramReq - * @param employeeId + * @param */ public void otherSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { long employeeId = user.getUID(); @@ -781,8 +781,9 @@ public class SIArchivesBiz { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //对于非系统人员,编辑后状态切换为正在缴纳 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setOtherArchivesId(updateOtherInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { otherSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesOtherSchemePO.builder() @@ -851,7 +852,7 @@ public class SIArchivesBiz { /** * @param paramReq - * @param employeeId + * @param */ public void fundSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { long employeeId = user.getUID(); @@ -927,8 +928,9 @@ public class SIArchivesBiz { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //对于非系统人员,编辑后状态切换为正在缴纳 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setFundArchivesId(updateFundInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { fundSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesFundSchemePO.builder() @@ -1001,7 +1003,7 @@ public class SIArchivesBiz { /** * @param paramReq - * @param employeeId + * @param */ public void socialSave(InsuranceArchivesSaveParam paramReq, User user, boolean welBaseDiffSign) { long employeeId = user.getUID(); @@ -1084,8 +1086,9 @@ public class SIArchivesBiz { if(baseInfoPO != null && baseInfoPO.getEmployeeType() != null && baseInfoPO.getEmployeeType().equals(DataCollectionEmployeeTypeEnum.EXT_EMPLOYEE.getValue())) { //对于非系统人员,编辑后状态切换为正在缴纳 baseInfoPO.setRunStatus(EmployeeStatusEnum.PAYING.getValue()); - getInsuranceBaseInfoMapper().updateById(baseInfoPO); } + baseInfoPO.setSocialArchivesId(updateSocialInfo.getId()); + getInsuranceBaseInfoMapper().updateById(baseInfoPO); sqlSession.commit(); } else { socialSchemeMapper.deleteByEmployeeIdAndPayOrg(InsuranceArchivesSocialSchemePO.builder()