diff --git a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java index fbddc78a4..7a2b758e6 100644 --- a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java @@ -108,7 +108,7 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic specialColumns.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> { list.add(new WeaTableColumn("150px",k, v)); }); - list.add(new WeaTableColumn("150px","" + SalaryI18nUtil.getI18nLabel( 0, "个人额外-社保合计") + "", "socialSpecialSum")); + list.add(new WeaTableColumn("150px","" + SalaryI18nUtil.getI18nLabel( 0, "单位超额-社保合计") + "", "socialSpecialSum")); personColumns.get(WelfareTypeEnum.ACCUMULATION_FUND.getValue()).forEach((k, v) -> { list.add(new WeaTableColumn("150px",k, v)); }); @@ -117,7 +117,7 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic specialColumns.get(WelfareTypeEnum.ACCUMULATION_FUND.getValue()).forEach((k, v) -> { list.add(new WeaTableColumn("150px",k, v)); }); - list.add(new WeaTableColumn("150px","" + SalaryI18nUtil.getI18nLabel( 0, "个人额外-公积金合计") + "", "fundSpecialSum")); + list.add(new WeaTableColumn("150px","" + SalaryI18nUtil.getI18nLabel( 0, "单位超额-公积金合计") + "", "fundSpecialSum")); personColumns.get(WelfareTypeEnum.OTHER.getValue()).forEach((k, v) -> { list.add(new WeaTableColumn("150px",k, v)); }); @@ -135,6 +135,7 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic list.add(new WeaTableColumn("150px",k, v)); }); list.add(new WeaTableColumn("150px","" + SalaryI18nUtil.getI18nLabel( 100396, "其他福利单位合计") + "", "otherComSum")); + list.add(new WeaTableColumn("150px","" + SalaryI18nUtil.getI18nLabel( 0, "单位超额-合计") + "", "specialSum")); list.add(new WeaTableColumn("150px","" + SalaryI18nUtil.getI18nLabel( 100397, "单位合计") + "", "comSum")); list.add(new WeaTableColumn("150px","" + SalaryI18nUtil.getI18nLabel( 100398, "社保合计") + "", "socialSum")); list.add(new WeaTableColumn("150px","" + SalaryI18nUtil.getI18nLabel( 100399, "公积金合计") + "", "fundSum")); @@ -406,12 +407,12 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic Map fundColumns = new HashMap<>(); socailIds.stream().forEach(social -> { if (categoryIdNameMap.containsKey(social)) { - socialColumns.put(SalaryI18nUtil.getI18nLabel( 0, "个人额外-") + categoryIdNameMap.get(social) , social + "socialSpecial"); + socialColumns.put(SalaryI18nUtil.getI18nLabel( 0, "单位超额-") + categoryIdNameMap.get(social) , social + "socialSpecial"); } }); fundIds.stream().forEach(social -> { if (categoryIdNameMap.containsKey(social)) { - fundColumns.put(SalaryI18nUtil.getI18nLabel( 0, "个人额外-") + categoryIdNameMap.get(social), social + "fundSpecial"); + fundColumns.put(SalaryI18nUtil.getI18nLabel( 0, "单位超额-") + categoryIdNameMap.get(social), social + "fundSpecial"); } }); diff --git a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java index 17732eacf..efd1666a5 100644 --- a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java @@ -271,30 +271,30 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ } } - - // 钱智 社保差异 - final BigDecimal[] socialSpecialSum = {new BigDecimal(0)}; - if (StringUtils.isNotEmpty(item.getSocialSpecialJson())) { - Map socialSpecialJson = JSON.parseObject(item.getSocialSpecialJson(), new HashMap().getClass()); - if(socialSpecialJson!=null){ - socialSpecialJson.forEach((k, v) -> { - String standardSocialPer = Util.null2String(record.get(k + "socialPer")); - BigDecimal standardSocialPerVal = new BigDecimal(0); - BigDecimal specialSocialPerVal = new BigDecimal(0); - if (NumberUtils.isCreatable(standardSocialPer)) { - standardSocialPerVal = new BigDecimal(standardSocialPer); - } - if (v != null && NumberUtils.isCreatable(v.toString())) { - specialSocialPerVal = new BigDecimal(v.toString()); - } - BigDecimal subtract = specialSocialPerVal.subtract(standardSocialPerVal); - socialSpecialSum[0] = socialSpecialSum[0].add(subtract); - record.put(k + "socialSpecial", subtract.toString()); - }); - } - } + // + // // 钱智 社保差异 + // final BigDecimal[] socialSpecialSum = {new BigDecimal(0)}; + // if (StringUtils.isNotEmpty(item.getSocialSpecialJson())) { + // Map socialSpecialJson = JSON.parseObject(item.getSocialSpecialJson(), new HashMap().getClass()); + // if(socialSpecialJson!=null){ + // socialSpecialJson.forEach((k, v) -> { + // String standardSocialPer = Util.null2String(record.get(k + "socialPer")); + // BigDecimal standardSocialPerVal = new BigDecimal(0); + // BigDecimal specialSocialPerVal = new BigDecimal(0); + // if (NumberUtils.isCreatable(standardSocialPer)) { + // standardSocialPerVal = new BigDecimal(standardSocialPer); + // } + // if (v != null && NumberUtils.isCreatable(v.toString())) { + // specialSocialPerVal = new BigDecimal(v.toString()); + // } + // BigDecimal subtract = specialSocialPerVal.subtract(standardSocialPerVal); + // socialSpecialSum[0] = socialSpecialSum[0].add(subtract); + // record.put(k + "socialSpecial", subtract.toString()); + // }); + // } + // } record.put("socialPerSum", item.getSocialPerSum()); - record.put("socialSpecialSum", socialSpecialSum[0]); + // record.put("socialSpecialSum", socialSpecialSum[0]); if (StringUtils.isNotEmpty(item.getFundPerJson())) { Map fundPerJson = JSON.parseObject(item.getFundPerJson(), new HashMap().getClass()); if(fundPerJson!=null){ @@ -304,29 +304,29 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ } } - // 钱智 公积金差异 - final BigDecimal[] fundSpecialSum = {new BigDecimal(0)}; - if (StringUtils.isNotEmpty(item.getFundSpecialJson())) { - Map fundSpecialJson = JSON.parseObject(item.getFundSpecialJson(), new HashMap().getClass()); - if(fundSpecialJson!=null){ - fundSpecialJson.forEach((k, v) -> { - String standardFundPer = Util.null2String(record.get(k + "fundPer")); - BigDecimal standardFundPerVal = new BigDecimal(0); - BigDecimal specialFundPerVal = new BigDecimal(0); - if (NumberUtils.isCreatable(standardFundPer)) { - standardFundPerVal = new BigDecimal(standardFundPer); - } - if (v != null && NumberUtils.isCreatable(v.toString())) { - specialFundPerVal = new BigDecimal(v.toString()); - } - BigDecimal subtract = specialFundPerVal.subtract(standardFundPerVal); - fundSpecialSum[0] = fundSpecialSum[0].add(subtract); - record.put(k + "fundSpecial", subtract.toString()); - }); - } - } + // // 钱智 公积金差异 + // final BigDecimal[] fundSpecialSum = {new BigDecimal(0)}; + // if (StringUtils.isNotEmpty(item.getFundSpecialJson())) { + // Map fundSpecialJson = JSON.parseObject(item.getFundSpecialJson(), new HashMap().getClass()); + // if(fundSpecialJson!=null){ + // fundSpecialJson.forEach((k, v) -> { + // String standardFundPer = Util.null2String(record.get(k + "fundPer")); + // BigDecimal standardFundPerVal = new BigDecimal(0); + // BigDecimal specialFundPerVal = new BigDecimal(0); + // if (NumberUtils.isCreatable(standardFundPer)) { + // standardFundPerVal = new BigDecimal(standardFundPer); + // } + // if (v != null && NumberUtils.isCreatable(v.toString())) { + // specialFundPerVal = new BigDecimal(v.toString()); + // } + // BigDecimal subtract = specialFundPerVal.subtract(standardFundPerVal); + // fundSpecialSum[0] = fundSpecialSum[0].add(subtract); + // record.put(k + "fundSpecial", subtract.toString()); + // }); + // } + // } record.put("fundPerSum", item.getFundPerSum()); - record.put("fundSpecialSum", fundSpecialSum[0]); + // record.put("fundSpecialSum", fundSpecialSum[0]); if (StringUtils.isNotEmpty(item.getOtherPerJson())) { Map fundPerJson = JSON.parseObject(item.getOtherPerJson(), new HashMap().getClass()); if(fundPerJson!=null){ @@ -370,6 +370,54 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ } record.put("otherComSum", item.getOtherComSum()); + + // 钱智 社保差异 + final BigDecimal[] socialSpecialSum = {new BigDecimal(0)}; + if (StringUtils.isNotEmpty(item.getSocialSpecialJson())) { + Map socialSpecialJson = JSON.parseObject(item.getSocialSpecialJson(), new HashMap().getClass()); + if(socialSpecialJson!=null){ + socialSpecialJson.forEach((k, v) -> { + String standardSocialPer = Util.null2String(record.get(k + "socialPer")); + BigDecimal standardSocialPerVal = new BigDecimal(0); + if (NumberUtils.isCreatable(standardSocialPer)) { + standardSocialPerVal = new BigDecimal(standardSocialPer); + } + String standardSocialCom = Util.null2String(record.get(k + "socialCom")); + BigDecimal standardComPerVal = new BigDecimal(0); + if (NumberUtils.isCreatable(standardSocialCom)) { + standardComPerVal = new BigDecimal(standardSocialCom); + } + BigDecimal subtract = standardSocialPerVal.subtract(standardComPerVal); + socialSpecialSum[0] = socialSpecialSum[0].add(subtract); + record.put(k + "socialSpecial", subtract.toString()); + }); + } + } + record.put("socialSpecialSum", socialSpecialSum[0].toPlainString()); + // 钱智 公积金差异 + final BigDecimal[] fundSpecialSum = {new BigDecimal(0)}; + if (StringUtils.isNotEmpty(item.getFundSpecialJson())) { + Map fundSpecialJson = JSON.parseObject(item.getFundSpecialJson(), new HashMap().getClass()); + if(fundSpecialJson!=null){ + fundSpecialJson.forEach((k, v) -> { + String standardFundPer = Util.null2String(record.get(k + "fundPer")); + BigDecimal standardFundPerVal = new BigDecimal(0); + if (NumberUtils.isCreatable(standardFundPer)) { + standardFundPerVal = new BigDecimal(standardFundPer); + } + String standardFundCom = Util.null2String(record.get(k + "fundCom")); + BigDecimal standardFundComVal = new BigDecimal(0); + if (NumberUtils.isCreatable(standardFundCom)) { + standardFundComVal = new BigDecimal(standardFundCom); + } + BigDecimal subtract = standardFundPerVal.subtract(standardFundComVal); + fundSpecialSum[0] = fundSpecialSum[0].add(subtract); + record.put(k + "fundSpecial", subtract.toString()); + }); + } + } + record.put("fundSpecialSum", fundSpecialSum[0].toPlainString()); + record.put("specialSum", socialSpecialSum[0].add(fundSpecialSum[0]).toPlainString()); record.put("comSum", item.getComSum()); record.put("socialSum", item.getSocialSum()); record.put("fundSum", item.getFundSum()); diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 73db14b83..b568ea517 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -419,7 +419,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //动态列组装 List weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, queryParam.getPaymentStatus()); - + weaTableColumn = weaTableColumn.stream().filter(col -> !col.getText().contains("单位超额-")).collect(Collectors.toList()); SalaryWeaTable table = new SalaryWeaTable<>(user, InsuranceAccountDetailPO.class); table.setColumns(weaTableColumn); List columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList()); @@ -489,7 +489,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //动态列组装 List weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, queryParam.getPaymentStatus()); - + weaTableColumn = weaTableColumn.stream().filter(col -> !col.getText().contains("单位超额-")).collect(Collectors.toList()); SalaryWeaTable table = new SalaryWeaTable<>(user, InsuranceAccountDetailPO.class); table.setColumns(weaTableColumn); List columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList()); @@ -548,7 +548,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { //动态列组装 List weaTableColumn = getColumnBuildService(user).buildCommonColumnsWithStyle(insuranceAccountDetailPOS, employeeId, SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY, queryParam.getPaymentStatus()); - + weaTableColumn = weaTableColumn.stream().filter(col -> !col.getText().contains("单位超额-")).collect(Collectors.toList()); SalaryWeaTable table = new SalaryWeaTable<>(user, InsuranceAccountDetailPO.class); table.setColumns(weaTableColumn); List columns = weaTableColumn.stream().map(v -> new Column(v.getText(), v.getColumn(), v.getColumn())).collect(Collectors.toList()); @@ -1091,7 +1091,12 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { record.put(k + "socialCommonPer", v); }); } - + if (commonSiAcct != null && StringUtils.isNotEmpty(commonSiAcct.getSocialComJson())) { + Map socialJson = JSON.parseObject(commonSiAcct.getSocialComJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "socialCommonCom", v); + }); + } // 钱智 社保差异 final BigDecimal[] socialSpecialSum = {new BigDecimal(0)}; if (StringUtils.isNotEmpty(item.getSocialSpecialJson())) { @@ -1100,25 +1105,20 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { socialSpecialJson.forEach((k, v) -> { String standardSocialPer = Util.null2String(record.get(k + "socialCommonPer")); BigDecimal standardSocialPerVal = new BigDecimal(0); - BigDecimal specialSocialPerVal = new BigDecimal(0); if (org.apache.commons.lang3.math.NumberUtils.isCreatable(standardSocialPer)) { standardSocialPerVal = new BigDecimal(standardSocialPer); } - if (v != null && org.apache.commons.lang3.math.NumberUtils.isCreatable(v.toString())) { - specialSocialPerVal = new BigDecimal(v.toString()); + String standardSocialCom = Util.null2String(record.get(k + "socialCommonCom")); + BigDecimal standardComPerVal = new BigDecimal(0); + if (org.apache.commons.lang3.math.NumberUtils.isCreatable(standardSocialCom)) { + standardComPerVal = new BigDecimal(standardSocialCom); } - BigDecimal subtract = specialSocialPerVal.subtract(standardSocialPerVal); + BigDecimal subtract = standardSocialPerVal.subtract(standardComPerVal); socialSpecialSum[0] = socialSpecialSum[0].add(subtract); record.put(k + "socialSpecial", subtract.toString()); }); } } - if (commonSiAcct != null && StringUtils.isNotEmpty(commonSiAcct.getSocialComJson())) { - Map socialJson = JSON.parseObject(commonSiAcct.getSocialComJson(), new HashMap().getClass()); - socialJson.forEach((k, v) -> { - record.put(k + "socialCommonCom", v); - }); - } record.put("socialPerCommonSum", commonSiAcct != null ? commonSiAcct.getSocialPerSum() : new BigDecimal("0")); record.put("socialComCommonSum", commonSiAcct != null ? commonSiAcct.getSocialComSum() : new BigDecimal("0")); record.put("socialSpecialSum", socialSpecialSum[0]); @@ -1160,6 +1160,12 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { record.put(k + "fundCommonPer", v); }); } + if (commonSiAcct != null && StringUtils.isNotEmpty(commonSiAcct.getFundComJson())) { + Map socialJson = JSON.parseObject(commonSiAcct.getFundComJson(), new HashMap().getClass()); + socialJson.forEach((k, v) -> { + record.put(k + "fundCommonCom", v); + }); + } // 钱智 公积金差异 final BigDecimal[] fundSpecialSum = {new BigDecimal(0)}; if (StringUtils.isNotEmpty(item.getFundSpecialJson())) { @@ -1168,25 +1174,20 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { fundSpecialJson.forEach((k, v) -> { String standardFundPer = Util.null2String(record.get(k + "fundCommonPer")); BigDecimal standardFundPerVal = new BigDecimal(0); - BigDecimal specialFundPerVal = new BigDecimal(0); if (org.apache.commons.lang3.math.NumberUtils.isCreatable(standardFundPer)) { standardFundPerVal = new BigDecimal(standardFundPer); } - if (v != null && org.apache.commons.lang3.math.NumberUtils.isCreatable(v.toString())) { - specialFundPerVal = new BigDecimal(v.toString()); + String standardFundCom = Util.null2String(record.get(k + "fundCommonCom")); + BigDecimal standardFundComVal = new BigDecimal(0); + if (org.apache.commons.lang3.math.NumberUtils.isCreatable(standardFundCom)) { + standardFundComVal = new BigDecimal(standardFundCom); } - BigDecimal subtract = specialFundPerVal.subtract(standardFundPerVal); + BigDecimal subtract = standardFundPerVal.subtract(standardFundComVal); fundSpecialSum[0] = fundSpecialSum[0].add(subtract); record.put(k + "fundSpecial", subtract.toString()); }); } } - if (commonSiAcct != null && StringUtils.isNotEmpty(commonSiAcct.getFundComJson())) { - Map socialJson = JSON.parseObject(commonSiAcct.getFundComJson(), new HashMap().getClass()); - socialJson.forEach((k, v) -> { - record.put(k + "fundCommonCom", v); - }); - } record.put("fundPerCommonSum", commonSiAcct != null ? commonSiAcct.getFundPerSum() : new BigDecimal("0")); record.put("fundComCommonSum", commonSiAcct != null ? commonSiAcct.getFundComSum() : new BigDecimal("0")); record.put("fundSpecialSum", fundSpecialSum[0]); @@ -1303,8 +1304,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { commonResult.put(SalaryI18nUtil.getI18nLabel(0, "社保个人正常缴纳合计"), "socialPerCommonSum"); commonResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人正常缴纳合计"), "fundPerCommonSum"); commonResult.put(SalaryI18nUtil.getI18nLabel(0, "其他福利个人正常缴纳合计"), "otherPerCommonSum"); - commonResult.put(SalaryI18nUtil.getI18nLabel(0, "个人额外-社保合计"), "socialSpecialSum"); - commonResult.put(SalaryI18nUtil.getI18nLabel(0, "个人额外-公积金合计"), "fundSpecialSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "单位超额-社保合计"), "socialSpecialSum"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "单位超额-公积金合计"), "fundSpecialSum"); repairResult.put(SalaryI18nUtil.getI18nLabel(0, "个人补缴合计"), "perRepairSum"); repairResult.put(SalaryI18nUtil.getI18nLabel(0, "社保个人补缴合计"), "socialPerRepairSum"); repairResult.put(SalaryI18nUtil.getI18nLabel(0, "公积金个人补缴合计"), "fundPerRepairSum"); @@ -1322,7 +1323,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "socialPer"); commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳个人"), item.getId() + "socialCommonPer"); - commonResult.put(SalaryI18nUtil.getI18nLabel(0, "个人额外-") + categoryIdNameMap.get(String.valueOf(item.getId())) , item.getId() + "socialSpecial"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "单位超额-") + categoryIdNameMap.get(String.valueOf(item.getId())) , item.getId() + "socialSpecial"); repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴个人"), item.getId() + "socialRepairPer"); balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差个人"), item.getId() + "socialBalancePer"); } @@ -1332,7 +1333,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } result.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(87159, "个人"), item.getId() + "fundPer"); commonResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "正常缴纳个人"), item.getId() + "fundCommonPer"); - commonResult.put(SalaryI18nUtil.getI18nLabel(0, "个人额外-") + categoryIdNameMap.get(String.valueOf(item.getId())) , item.getId() + "fundSpecial"); + commonResult.put(SalaryI18nUtil.getI18nLabel(0, "单位超额-") + categoryIdNameMap.get(String.valueOf(item.getId())) , item.getId() + "fundSpecial"); repairResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补缴个人"), item.getId() + "fundRepairPer"); balanceResult.put(categoryIdNameMap.get(String.valueOf(item.getId())) + SalaryI18nUtil.getI18nLabel(0, "补差个人"), item.getId() + "fundBalancePer"); } @@ -2270,8 +2271,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { Map fundComMap = new HashMap<>(); Map otherComMap = new HashMap<>(); - Map socialSpecialMap = new HashMap<>(); - Map fundSpecialMap = new HashMap<>(); + // Map socialSpecialMap = new HashMap<>(); + // Map fundSpecialMap = new HashMap<>(); //筛选出福利核算项 Map toDealMap = @@ -2327,28 +2328,28 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } } - // 钱智二开 - //获取元素名后缀,方便之后判断“个人”或“单位” - if (StringUtils.isNotBlank(keyName) && keyName.length() > 5) { - String specialScope = keyName.substring(0,5); - if (specialScope.equals("个人额外-")) { - categoryPOList = getSICategoryService(user).listByName(entry.getKey().substring(5)); - if (categoryPOList.size() == 1) { - ICategoryPO iCategoryPO = categoryPOList.get(0); - welfareType = iCategoryPO.getWelfareType(); - switch (welfareType) { - case 1: - socialSpecialMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - case 2: - fundSpecialMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); - break; - default: - throw new SalaryRunTimeException("福利类型不存在"); - } - } - } - } + // // 钱智二开 + // //获取元素名后缀,方便之后判断“个人”或“单位” + // if (StringUtils.isNotBlank(keyName) && keyName.length() > 5) { + // String specialScope = keyName.substring(0,5); + // if (specialScope.equals("个人额外-")) { + // categoryPOList = getSICategoryService(user).listByName(entry.getKey().substring(5)); + // if (categoryPOList.size() == 1) { + // ICategoryPO iCategoryPO = categoryPOList.get(0); + // welfareType = iCategoryPO.getWelfareType(); + // switch (welfareType) { + // case 1: + // socialSpecialMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); + // break; + // case 2: + // fundSpecialMap.put(iCategoryPO.getId().toString(), entry.getValue().toString()); + // break; + // default: + // throw new SalaryRunTimeException("福利类型不存在"); + // } + // } + // } + // } } //组装新的insuranceAccountDetailPO对象数据 @@ -2363,10 +2364,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { insuranceAccountDetailPO.setSocialComJson(JSON.toJSONString(socialComMap)); } - if (!socialSpecialMap.isEmpty()) { - checkJsonMap(socialSpecialMap, insuranceAccountDetailPO.getSocialSpecialJson()); - insuranceAccountDetailPO.setSocialSpecialJson(JSON.toJSONString(socialSpecialMap)); - } + // if (!socialSpecialMap.isEmpty()) { + // checkJsonMap(socialSpecialMap, insuranceAccountDetailPO.getSocialSpecialJson()); + // insuranceAccountDetailPO.setSocialSpecialJson(JSON.toJSONString(socialSpecialMap)); + // } if (!fundPerMap.isEmpty()) { checkJsonMap(fundPerMap, insuranceAccountDetailPO.getFundPerJson()); @@ -2377,10 +2378,10 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { checkJsonMap(fundComMap, insuranceAccountDetailPO.getFundComJson()); insuranceAccountDetailPO.setFundComJson(JSON.toJSONString(fundComMap)); } - if (!fundSpecialMap.isEmpty()) { - checkJsonMap(fundSpecialMap, insuranceAccountDetailPO.getFundSpecialJson()); - insuranceAccountDetailPO.setFundSpecialJson(JSON.toJSONString(fundSpecialMap)); - } + // if (!fundSpecialMap.isEmpty()) { + // checkJsonMap(fundSpecialMap, insuranceAccountDetailPO.getFundSpecialJson()); + // insuranceAccountDetailPO.setFundSpecialJson(JSON.toJSONString(fundSpecialMap)); + // } if (!otherPerMap.isEmpty()) { checkJsonMap(otherPerMap, insuranceAccountDetailPO.getOtherPerJson()); @@ -4470,7 +4471,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { public Map countSum(List> records ){ // 获取需要统计的列 - String[] keys = {"Base", "Com", "Sum", "Per", "total"}; + String[] keys = {"Base", "Com", "Sum", "Per", "total", "Special"}; Set numKeys = new HashSet<>(); // for(String key : maxSizeRecord.keySet()){ // if(StringUtils.containsAny(key,keys)){ @@ -5478,6 +5479,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { insuranceAccountDetailPO.setFundSchemeId(fundPO.getFundSchemeId()); insuranceAccountDetailPO.setFundPaymentBaseString(fundPO.getFundPaymentBaseString()); insuranceAccountDetailPO.setFundPaymentComBaseString(fundPO.getFundPaymentComBaseString()); + Map fundBaseMap = JSON.parseObject(fundPO.getFundPaymentBaseString(), new HashMap().getClass()); //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), fundPO.getFundStartTime(), fundPO.getFundEndTime()); if ((NonPaymentEnum.YES.getValue().equals(fundPO.getNonPayment()) || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { @@ -5551,12 +5553,19 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { BigDecimal specialProportion = ufTsrysjsbfldaPO.getDybl().divide(new BigDecimal("100")); specialResult = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), ufTsrysjsbfldaPO.getDyjs().multiply(specialProportion)); specialFundJsonMap.put(String.valueOf(e), specialResult.toPlainString()); + // 覆盖至个人部分 + result = specialResult; + // 基数也要覆盖 + if (fundBaseMap.containsKey(String.valueOf(e))) { + fundBaseMap.put(String.valueOf(e), ufTsrysjsbfldaPO.getDyjs().toPlainString()); + } } fundPerJsonMap.put(String.valueOf(e), result.toPlainString()); fundPer.add(result); }); insuranceAccountDetailPO.setFundPerJson(JSON.toJSONString(fundPerJsonMap)); insuranceAccountDetailPO.setFundSpecialJson(JSON.toJSONString(specialFundJsonMap)); + insuranceAccountDetailPO.setFundPaymentBaseString(JSON.toJSONString(fundBaseMap)); BigDecimal funPerSum = new BigDecimal("0"); for (BigDecimal bigDecimal : fundPer) { funPerSum = funPerSum.add(bigDecimal); @@ -5652,6 +5661,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { insuranceAccountDetailPO.setSocialSchemeId(socialPO.getSocialSchemeId()); insuranceAccountDetailPO.setSocialPaymentBaseString(socialPO.getSocialPaymentBaseString()); insuranceAccountDetailPO.setSocialPaymentComBaseString(socialPO.getSocialPaymentComBaseString()); + Map socialBaseMap = JSON.parseObject(socialPO.getSocialPaymentBaseString(), new HashMap().getClass()); + //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); if ((NonPaymentEnum.YES.getValue().equals(socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { @@ -5728,12 +5739,19 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { BigDecimal specialProportion = ufTsrysjsbfldaPO.getDybl().divide(new BigDecimal("100")); specialResult = SalaryEntityUtil.carryRule(newScale, po.getRententionRule(), ufTsrysjsbfldaPO.getDyjs().multiply(specialProportion)); specialSocialJsonMap.put(String.valueOf(e), specialResult.toPlainString()); + // 覆盖至个人部分 + result = specialResult; + // 基数也要覆盖 + if (socialBaseMap.containsKey(String.valueOf(e))) { + socialBaseMap.put(String.valueOf(e), ufTsrysjsbfldaPO.getDyjs().toPlainString()); + } } socialPerJsonMap.put(String.valueOf(e), result.toPlainString()); socialPer.add(result); }); insuranceAccountDetailPO.setSocialPerJson(JSON.toJSONString(socialPerJsonMap)); insuranceAccountDetailPO.setSocialSpecialJson(JSON.toJSONString(specialSocialJsonMap)); + insuranceAccountDetailPO.setSocialPaymentBaseString(JSON.toJSONString(socialBaseMap)); BigDecimal socialPerSum = new BigDecimal("0"); for (BigDecimal bigDecimal : socialPer) { socialPerSum = socialPerSum.add(bigDecimal); diff --git a/src/com/engine/salary/service/impl/SIExportServiceImpl.java b/src/com/engine/salary/service/impl/SIExportServiceImpl.java index 20790fba9..500d33e44 100644 --- a/src/com/engine/salary/service/impl/SIExportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIExportServiceImpl.java @@ -221,6 +221,9 @@ public class SIExportServiceImpl extends Service implements SIExportService { // columns = buildCommonColumns(accountExportPOS, true); // } columns = buildCommonColumns(accountExportPOS, paymentStatus); + if (paymentStatus != 0) { + columns = columns.stream().filter(col -> !col.getText().contains("单位超额-")).collect(Collectors.toList()); + } records = buildCommonRecords(accountExportPOS, false); List> excelSheetData = new ArrayList<>(); @@ -461,29 +464,29 @@ public class SIExportServiceImpl extends Service implements SIExportService { } } - // 钱智 社保差异 - final BigDecimal[] socialSpecialSum = {new BigDecimal(0)}; - if (StringUtils.isNotEmpty(item.getSocialSpecialJson())) { - Map socialSpecialJson = JSON.parseObject(item.getSocialSpecialJson(), new HashMap().getClass()); - if(socialSpecialJson!=null){ - socialSpecialJson.forEach((k, v) -> { - String standardSocialPer = Util.null2String(record.get(k + "socialPer")); - BigDecimal standardSocialPerVal = new BigDecimal(0); - BigDecimal specialSocialPerVal = new BigDecimal(0); - if (NumberUtils.isCreatable(standardSocialPer)) { - standardSocialPerVal = new BigDecimal(standardSocialPer); - } - if (v != null && NumberUtils.isCreatable(v.toString())) { - specialSocialPerVal = new BigDecimal(v.toString()); - } - BigDecimal subtract = specialSocialPerVal.subtract(standardSocialPerVal); - socialSpecialSum[0] = socialSpecialSum[0].add(subtract); - record.put(k + "socialSpecial", subtract.toString()); - }); - } - } + // // 钱智 社保差异 + // final BigDecimal[] socialSpecialSum = {new BigDecimal(0)}; + // if (StringUtils.isNotEmpty(item.getSocialSpecialJson())) { + // Map socialSpecialJson = JSON.parseObject(item.getSocialSpecialJson(), new HashMap().getClass()); + // if(socialSpecialJson!=null){ + // socialSpecialJson.forEach((k, v) -> { + // String standardSocialPer = Util.null2String(record.get(k + "socialPer")); + // BigDecimal standardSocialPerVal = new BigDecimal(0); + // BigDecimal specialSocialPerVal = new BigDecimal(0); + // if (NumberUtils.isCreatable(standardSocialPer)) { + // standardSocialPerVal = new BigDecimal(standardSocialPer); + // } + // if (v != null && NumberUtils.isCreatable(v.toString())) { + // specialSocialPerVal = new BigDecimal(v.toString()); + // } + // BigDecimal subtract = specialSocialPerVal.subtract(standardSocialPerVal); + // socialSpecialSum[0] = socialSpecialSum[0].add(subtract); + // record.put(k + "socialSpecial", subtract.toString()); + // }); + // } + // } record.put("socialPerSum", item.getSocialPerSum()); - record.put("socialSpecialSum", socialSpecialSum[0]); + // record.put("socialSpecialSum", socialSpecialSum[0]); if (StringUtils.isNotEmpty(item.getFundPerJson())) { Map fundPerJson = JSON.parseObject(item.getFundPerJson(), new HashMap().getClass()); if (fundPerJson != null) { @@ -493,28 +496,28 @@ public class SIExportServiceImpl extends Service implements SIExportService { } } - final BigDecimal[] fundSpecialSum = {new BigDecimal(0)}; - if (StringUtils.isNotEmpty(item.getFundSpecialJson())) { - Map fundSpecialJson = JSON.parseObject(item.getFundSpecialJson(), new HashMap().getClass()); - if(fundSpecialJson!=null){ - fundSpecialJson.forEach((k, v) -> { - String standardFundPer = Util.null2String(record.get(k + "fundPer")); - BigDecimal standardFundPerVal = new BigDecimal(0); - BigDecimal specialFundPerVal = new BigDecimal(0); - if (NumberUtils.isCreatable(standardFundPer)) { - standardFundPerVal = new BigDecimal(standardFundPer); - } - if (v != null && NumberUtils.isCreatable(v.toString())) { - specialFundPerVal = new BigDecimal(v.toString()); - } - BigDecimal subtract = specialFundPerVal.subtract(standardFundPerVal); - fundSpecialSum[0] = fundSpecialSum[0].add(subtract); - record.put(k + "fundSpecial", subtract.toString()); - }); - } - } + // final BigDecimal[] fundSpecialSum = {new BigDecimal(0)}; + // if (StringUtils.isNotEmpty(item.getFundSpecialJson())) { + // Map fundSpecialJson = JSON.parseObject(item.getFundSpecialJson(), new HashMap().getClass()); + // if(fundSpecialJson!=null){ + // fundSpecialJson.forEach((k, v) -> { + // String standardFundPer = Util.null2String(record.get(k + "fundPer")); + // BigDecimal standardFundPerVal = new BigDecimal(0); + // BigDecimal specialFundPerVal = new BigDecimal(0); + // if (NumberUtils.isCreatable(standardFundPer)) { + // standardFundPerVal = new BigDecimal(standardFundPer); + // } + // if (v != null && NumberUtils.isCreatable(v.toString())) { + // specialFundPerVal = new BigDecimal(v.toString()); + // } + // BigDecimal subtract = specialFundPerVal.subtract(standardFundPerVal); + // fundSpecialSum[0] = fundSpecialSum[0].add(subtract); + // record.put(k + "fundSpecial", subtract.toString()); + // }); + // } + // } record.put("fundPerSum", item.getFundPerSum()); - record.put("fundSpecialSum", fundSpecialSum[0]); + // record.put("fundSpecialSum", fundSpecialSum[0]); if (StringUtils.isNotEmpty(item.getOtherPerJson())) { Map fundPerJson = JSON.parseObject(item.getOtherPerJson(), new HashMap().getClass()); if (fundPerJson != null) { @@ -555,6 +558,54 @@ public class SIExportServiceImpl extends Service implements SIExportService { } } + + // 钱智 社保差异 + final BigDecimal[] socialSpecialSum = {new BigDecimal(0)}; + if (StringUtils.isNotEmpty(item.getSocialSpecialJson())) { + Map socialSpecialJson = JSON.parseObject(item.getSocialSpecialJson(), new HashMap().getClass()); + if(socialSpecialJson!=null){ + socialSpecialJson.forEach((k, v) -> { + String standardSocialPer = Util.null2String(record.get(k + "socialPer")); + BigDecimal standardSocialPerVal = new BigDecimal(0); + if (NumberUtils.isCreatable(standardSocialPer)) { + standardSocialPerVal = new BigDecimal(standardSocialPer); + } + String standardSocialCom = Util.null2String(record.get(k + "socialCom")); + BigDecimal standardComPerVal = new BigDecimal(0); + if (NumberUtils.isCreatable(standardSocialCom)) { + standardComPerVal = new BigDecimal(standardSocialCom); + } + BigDecimal subtract = standardSocialPerVal.subtract(standardComPerVal); + socialSpecialSum[0] = socialSpecialSum[0].add(subtract); + record.put(k + "socialSpecial", subtract.toString()); + }); + } + } + record.put("socialSpecialSum", socialSpecialSum[0].toPlainString()); + // 钱智 公积金差异 + final BigDecimal[] fundSpecialSum = {new BigDecimal(0)}; + if (StringUtils.isNotEmpty(item.getFundSpecialJson())) { + Map fundSpecialJson = JSON.parseObject(item.getFundSpecialJson(), new HashMap().getClass()); + if(fundSpecialJson!=null){ + fundSpecialJson.forEach((k, v) -> { + String standardFundPer = Util.null2String(record.get(k + "fundPer")); + BigDecimal standardFundPerVal = new BigDecimal(0); + if (NumberUtils.isCreatable(standardFundPer)) { + standardFundPerVal = new BigDecimal(standardFundPer); + } + String standardFundCom = Util.null2String(record.get(k + "fundCom")); + BigDecimal standardFundComVal = new BigDecimal(0); + if (NumberUtils.isCreatable(standardFundCom)) { + standardFundComVal = new BigDecimal(standardFundCom); + } + BigDecimal subtract = standardFundPerVal.subtract(standardFundComVal); + fundSpecialSum[0] = fundSpecialSum[0].add(subtract); + record.put(k + "fundSpecial", subtract.toString()); + }); + } + } + record.put("fundSpecialSum", fundSpecialSum[0].toPlainString()); + record.put("specialSum", socialSpecialSum[0].add(fundSpecialSum[0]).toPlainString()); record.put("otherComSum", item.getOtherComSum()); record.put("comSum", item.getComSum()); record.put("socialSum", item.getSocialSum()); @@ -747,12 +798,12 @@ public class SIExportServiceImpl extends Service implements SIExportService { Map fundColumns = new HashMap<>(); socailIds.stream().forEach(social -> { if (categoryIdNameMap.containsKey(social)) { - socialColumns.put(SalaryI18nUtil.getI18nLabel( 0, "个人额外-") + categoryIdNameMap.get(social) , social + "socialSpecial"); + socialColumns.put(SalaryI18nUtil.getI18nLabel( 0, "单位超额-") + categoryIdNameMap.get(social) , social + "socialSpecial"); } }); fundIds.stream().forEach(social -> { if (categoryIdNameMap.containsKey(social)) { - fundColumns.put(SalaryI18nUtil.getI18nLabel( 0, "个人额外-") + categoryIdNameMap.get(social), social + "fundSpecial"); + fundColumns.put(SalaryI18nUtil.getI18nLabel( 0, "单位超额-") + categoryIdNameMap.get(social), social + "fundSpecial"); } }); @@ -826,7 +877,7 @@ public class SIExportServiceImpl extends Service implements SIExportService { specialColumns.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> { list.add(new WeaTableColumn("150px",k, v)); }); - list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 0, "个人额外-社保合计"), "socialSpecialSum")); + list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 0, "单位超额-社保合计"), "socialSpecialSum")); personColumns.get(WelfareTypeEnum.ACCUMULATION_FUND.getValue()).forEach((k, v) -> { list.add(new WeaTableColumn("150px", k, v)); @@ -836,7 +887,7 @@ public class SIExportServiceImpl extends Service implements SIExportService { specialColumns.get(WelfareTypeEnum.ACCUMULATION_FUND.getValue()).forEach((k, v) -> { list.add(new WeaTableColumn("150px",k, v)); }); - list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 0, "个人额外-公积金合计"), "fundSpecialSum")); + list.add(new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 0, "单位超额-公积金合计"), "fundSpecialSum")); personColumns.get(WelfareTypeEnum.OTHER.getValue()).forEach((k, v) -> { list.add(new WeaTableColumn("150px", k, v)); @@ -855,6 +906,7 @@ public class SIExportServiceImpl extends Service implements SIExportService { list.add(new WeaTableColumn("150px", k, v)); }); list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(100396, "其他福利单位合计"), "otherComSum")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(0, "单位超额-合计"), "specialSum")); list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(100397, "单位合计"), "comSum")); list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(100398, "社保合计"), "socialSum")); list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(100399, "公积金合计"), "fundSum")); diff --git a/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java b/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java index cb16cb46c..516d93248 100644 --- a/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java @@ -28,7 +28,6 @@ import com.engine.salary.util.JsonUtil; import com.engine.salary.util.db.MapperProxyFactory; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; import weaver.servicefiles.DataSourceXML; @@ -115,10 +114,7 @@ public class SalaryFormulaWrapper extends Service { param.setSourceId("welfare"); //获取福利类薪资项目 List list = getRemoteExcelService(user).fieldList(param.getSourceId(), param.getExtendParam()); - list = list.stream().filter(f -> !(f.getName().contains("正常缴纳") || f.getName().contains("补缴") || f.getName().contains("补差") || f.getName().contains("申报基数") || f.getName().contains("个人额外-社保合计") || f.getName().contains("个人额外-公积金合计"))).collect(Collectors.toList()); - if (listType != null && listType.equals(NumberUtils.INTEGER_TWO)) { - list = list.stream().filter(f -> !(f.getName().contains("个人额外-"))).collect(Collectors.toList()); - } + list = list.stream().filter(f -> !(f.getName().contains("单位超额-") ||f.getName().contains("正常缴纳") || f.getName().contains("补缴") || f.getName().contains("补差") || f.getName().contains("申报基数"))).collect(Collectors.toList()); //提取出福利类项目名称 for (FormulaVar formulaVar : list) { InsuranceAcctDetailImportFieldDTO insuranceAcctDetailImportFieldDTO = new InsuranceAcctDetailImportFieldDTO(); @@ -151,7 +147,7 @@ public class SalaryFormulaWrapper extends Service { public List balanceWelfareList() { List welfareList = welfareList(null); - welfareList = welfareList.stream().filter(f -> !(f.getSalaryItemName().contains("合计") || f.getSalaryItemName().contains("个人额外-"))).collect(Collectors.toList()); + welfareList = welfareList.stream().filter(f -> !(f.getSalaryItemName().contains("合计") || f.getSalaryItemName().contains("单位超额-"))).collect(Collectors.toList()); List noUseICategoryList= getICategoryMapper().listAll().stream().filter(f -> f.getIsUse() == 0).collect(Collectors.toList()); if (noUseICategoryList.size() > 0) {