From b6ee197fe6735ea2adde5dd1e5bcc3dacda19faa Mon Sep 17 00:00:00 2001 From: sy Date: Tue, 7 Mar 2023 14:21:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F,=E6=A2=B3?= =?UTF-8?q?=E7=90=86Mapper=E7=B1=BB=E4=BD=BF=E7=94=A8=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 54 +++++++++++++------ .../service/impl/ColumnBuildServiceImpl.java | 8 ++- .../service/impl/RecordsBuildServiceImpl.java | 31 +++++++---- .../impl/SIAComparisonResultServiceImpl.java | 6 ++- .../service/impl/SIAccountServiceImpl.java | 26 +++++---- .../service/impl/SIArchivesServiceImpl.java | 4 +- .../service/impl/SICategoryServiceImpl.java | 2 +- .../impl/SICompensationServiceImpl.java | 6 ++- .../service/impl/SIExportServiceImpl.java | 10 ++-- .../service/impl/SIImportServiceImpl.java | 20 +++++-- .../service/impl/SIRepairServiceImpl.java | 10 ++-- .../service/impl/SISchemeServiceImpl.java | 4 +- .../salary/wrapper/SalaryFormulaWrapper.java | 6 ++- 13 files changed, 132 insertions(+), 55 deletions(-) diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index a567d2f78..a1d2073ab 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -117,6 +117,26 @@ public class SIAccountBiz extends Service { return (SalaryAcctProgressService) ServiceUtil.getService(SalaryAcctProgressServiceImpl.class, user); } + private SIAccountDetailTempMapper getSIAccountDetailTempMapper() { + return MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class); + } + + private InsuranceSchemeDetailMapper getInsuranceSchemeDetailMapper() { + return MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class); + } + + private EmployMapper getEmployMapper() { + return MapperProxyFactory.getProxy(EmployMapper.class); + } + + private ICategoryMapper getICategoryMapper() { + return MapperProxyFactory.getProxy(ICategoryMapper.class); + } + + private TaxAgentMapper getTaxAgentMapper() { + return MapperProxyFactory.getProxy(TaxAgentMapper.class); + } + public PageInfo listPage(InsuranceAccountBatchParam queryParam) { List list = getInsuranceAccountBatchMapper().list(queryParam); PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), @@ -343,7 +363,7 @@ public class SIAccountBiz extends Service { /*}*/ List> partition = Lists.partition((List) ids, 100); partition.forEach(part -> { - MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).batchDelByEmpIdsAndMonthAndPayOrg(part, param.getBillMonth(), param.getPaymentOrganization()); + getSIAccountDetailTempMapper().batchDelByEmpIdsAndMonthAndPayOrg(part, param.getBillMonth(), param.getPaymentOrganization()); }); getSalaryAcctProgressService(user).finish(SalaryCacheKey.ACCT_PROGRESS + param.getBillMonth(), true); @@ -414,14 +434,14 @@ public class SIAccountBiz extends Service { //临时表入库前先对(可能存在的)历史数据进行删除 List> partition = Lists.partition((List) ids, 100); partition.forEach(part -> { - MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).batchDelByEmpIdsAndMonthAndPayOrg(part, billMonth, paymentOrganization); + getSIAccountDetailTempMapper().batchDelByEmpIdsAndMonthAndPayOrg(part, billMonth, paymentOrganization); }); //临时表数据入库 if (CollectionUtils.isNotEmpty(list)) { encryptUtil.encryptList(list, InsuranceAccountDetailTempPO.class); List> lists = splitList(list, 40); lists.forEach(subList -> { - MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).batchSaveAccountTempDetails(subList); + getSIAccountDetailTempMapper().batchSaveAccountTempDetails(subList); }); } @@ -454,7 +474,7 @@ public class SIAccountBiz extends Service { //TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition()); String billMonth = param.getBillMonth(); try { - List list = MapperProxyFactory.getProxy(SIAccountDetailTempMapper.class).getListByEmployeeIdsAndBillMonth(ids, billMonth, param.getPaymentOrganization()); + List list = getSIAccountDetailTempMapper().getListByEmployeeIdsAndBillMonth(ids, billMonth, param.getPaymentOrganization()); encryptUtil.decryptList(list, InsuranceAccountDetailTempPO.class); Integer paymentStatus = 0; log.info("核算明细临时表 hrsa_bill_detail_temp待处理数量:{}", list.size()); @@ -533,7 +553,7 @@ public class SIAccountBiz extends Service { //判断是否在起始缴纳月和最后缴纳月之间 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) { - List detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(otherPO.getOtherSchemeId()); + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(otherPO.getOtherSchemeId()); encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); //方案中包含的需要缴纳其他的个人福利 int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1; @@ -675,7 +695,7 @@ public class SIAccountBiz extends Service { //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), fundPO.getFundStartTime(), fundPO.getFundEndTime()); if ((NonPaymentEnum.YES.getValue() == fundPO.getNonPayment() || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { - List detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(fundPO.getFundSchemeId()); + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(fundPO.getFundSchemeId()); encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); //方案中包含的需要缴纳社保的个人福利 int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1; @@ -816,7 +836,7 @@ public class SIAccountBiz extends Service { //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(insuranceAccountDetailPO.getBillMonth(), socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); if ((NonPaymentEnum.YES.getValue().equals(socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { - List detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(socialPO.getSocialSchemeId()); + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialPO.getSocialSchemeId()); encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); //方案中包含的需要缴纳社保的个人福利 int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1; @@ -1102,7 +1122,7 @@ public class SIAccountBiz extends Service { InsuranceAccountBatchPO insuranceAccountBatchPO = getInsuranceAccountBatchMapper().getByBillMonth(billMonth, param.getPaymentOrganization()); encryptUtil.decrypt(insuranceAccountBatchPO, InsuranceAccountBatchPO.class); - DataCollectionEmployee simpleEmployee = MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeById(employeeId); + DataCollectionEmployee simpleEmployee = getEmployMapper().getEmployeeById(employeeId); insuranceAccountBatchPO.setAccountant(currentUserName); insuranceAccountBatchPO.setUpdateTime(new Date()); insuranceAccountBatchPO.setSocialPay(socialSum.toPlainString()); @@ -1311,7 +1331,7 @@ public class SIAccountBiz extends Service { } if (!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { List ids = new ArrayList<>(); - List list = MapperProxyFactory.getProxy(ICategoryMapper.class).listByDataType(DataTypeEnum.SYSTEM.getValue()); + List list = getICategoryMapper().listByDataType(DataTypeEnum.SYSTEM.getValue()); if (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) { ICategoryPO insuranceCategoryPO = list.stream().filter(item -> SalaryI18nUtil.getI18nLabel(93113, "养老保险").equals(item.getInsuranceName())).findFirst() @@ -1376,7 +1396,7 @@ public class SIAccountBiz extends Service { //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, otherPO.getOtherStartTime(), otherPO.getOtherEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), otherPO.getNonPayment()) || otherPO.getNonPayment() == null) && otherPO.getOtherSchemeId() != null && inDataRange) { - List detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(otherPO.getOtherSchemeId()); + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(otherPO.getOtherSchemeId()); encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); //方案中包含的需要缴纳其他的个人福利 int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1; @@ -1517,7 +1537,7 @@ public class SIAccountBiz extends Service { //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, fundPO.getFundStartTime(), fundPO.getFundEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), fundPO.getNonPayment()) || fundPO.getNonPayment() == null) && fundPO.getFundSchemeId() != null && inDataRange) { - List detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(fundPO.getFundSchemeId()); + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(fundPO.getFundSchemeId()); encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); //方案中包含的需要缴纳社保的个人福利 int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1; @@ -1657,7 +1677,7 @@ public class SIAccountBiz extends Service { //判断是否在起始缴纳月和最后缴纳月之间 Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { - List detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(socialPO.getSocialSchemeId()); + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialPO.getSocialSchemeId()); encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); //方案中包含的需要缴纳社保的个人福利 int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1; @@ -1804,7 +1824,7 @@ public class SIAccountBiz extends Service { Boolean inDataRange = SalaryDateUtil.monthInRange(billMonth, socialPO.getSocialStartTime(), socialPO.getSocialEndTime()); if ((Objects.equals(NonPaymentEnum.YES.getValue(), socialPO.getNonPayment()) || socialPO.getNonPayment() == null) && socialPO.getSocialSchemeId() != null && inDataRange) { - List detailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryListBySchemeId(socialPO.getSocialSchemeId()); + List detailPOS = getInsuranceSchemeDetailMapper().queryListBySchemeId(socialPO.getSocialSchemeId()); encryptUtil.decryptList(detailPOS, InsuranceSchemeDetailPO.class); //方案中包含的需要缴纳社保的个人福利 int monthIndex = Integer.parseInt(billMonth.split("-")[1]) - 1; @@ -2043,7 +2063,7 @@ public class SIAccountBiz extends Service { public void file(String billMonth, Long employeeId, Long paymentOrganization) { // 归档前检查是否有核算异常 -// List insuranceAccountInspectPOS = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByInspectStatusAndBillMonth(InspectStatusEnum.IGNORE.getValue(),billMonth); +// List insuranceAccountInspectPOS = getInsuranceAccountInspectMapper().getByInspectStatusAndBillMonth(InspectStatusEnum.IGNORE.getValue(),billMonth); // SalaryAssert.isEmpty(insuranceAccountInspectPOS, SalaryI18nUtil.getI18nLabel( 100500, "当前核算月存在核算异常数据")); //开始归档数据 @@ -2100,7 +2120,7 @@ public class SIAccountBiz extends Service { public List allInspects(Collection ids, String billMonth) { - List list = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getList(billMonth, InspectStatusEnum.IGNORE.getValue(), ids); + List list = getInsuranceAccountInspectMapper().getList(billMonth, InspectStatusEnum.IGNORE.getValue(), ids); if (CollectionUtils.isNotEmpty(list)) { return list; @@ -2116,12 +2136,12 @@ public class SIAccountBiz extends Service { encryptUtil.decryptList(insuranceAccountDetailPOS, InsuranceAccountDetailPO.class); //获取扣缴义务人信息 - List paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); + List paymentList = getTaxAgentMapper().listAll(); SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(100341, "该租户无扣缴义务人")); Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity())); List insuranceAccountViewListDTOS = buildRecords(insuranceAccountDetailPOS, paymentMap); -// List iCategoryPOS = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); +// List iCategoryPOS = getICategoryMapper().listAll(); // Page page = FormatManager.getTablePage(); // Page insuranceAccountViewListDTOPage = new Page<>(page.getCurrent(), insuranceAccountViewListDTOS.size(), insuranceAccountViewListDTOS.size(), // page.isSearchCount()); diff --git a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java index 64a053093..5e868d42b 100644 --- a/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/ColumnBuildServiceImpl.java @@ -30,10 +30,14 @@ import java.util.stream.Collectors; * @Version V1.0 **/ public class ColumnBuildServiceImpl extends Service implements ColumnBuildService { + + private ICategoryMapper getICategoryMapper() { + return MapperProxyFactory.getProxy(ICategoryMapper.class); + } @Override public List buildCommonColumnsWithStyle(List pos, Long employeeId, String tenantKey, Integer paymentStatus) { List list = new ArrayList<>(); - Map categoryIdNameMap = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName)); + Map categoryIdNameMap = getICategoryMapper().listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName)); Map> columns = buildPaymentTitle(pos, categoryIdNameMap, employeeId, tenantKey); Map> personColumns = buildPersonalTitle(pos, categoryIdNameMap, employeeId, tenantKey); Map> comColumns = buildComTitle(pos, categoryIdNameMap, employeeId, tenantKey); @@ -297,7 +301,7 @@ public class ColumnBuildServiceImpl extends Service implements ColumnBuildServic SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); List employeeIds = pos.stream().map(InsuranceAccountInspectPO::getEmployeeId).collect(Collectors.toList()); Map insuranceArchivesAccountPOMap = siArchivesBiz.buildBatchAccount(employeeIds, paymentOrganization); - Map categoryIdNameMap = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName)); + Map categoryIdNameMap = getICategoryMapper().listAll().stream().collect(Collectors.toMap(ICategoryPO -> String.valueOf(ICategoryPO.getId()), ICategoryPO::getInsuranceName)); Map> columns = buildInspectTableTitle(new ArrayList<>(insuranceArchivesAccountPOMap.values()), categoryIdNameMap); WeaTableColumn weaTableNameColumn = new WeaTableColumn("150px",SalaryI18nUtil.getI18nLabel( 85429, "姓名"), "userName"); weaTableNameColumn.setFixed("left"); diff --git a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java index b1d5958b0..d6cc2e8f9 100644 --- a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java @@ -15,6 +15,7 @@ import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.siaccount.BillStatusEnum; import com.engine.salary.enums.siaccount.ResourceFromEnum; import com.engine.salary.mapper.datacollection.EmployMapper; +import com.engine.salary.mapper.siaccount.InsuranceAccountInspectMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.RecordsBuildService; @@ -38,6 +39,18 @@ import java.util.stream.Collectors; **/ public class RecordsBuildServiceImpl extends Service implements RecordsBuildService { + private EmployMapper getEmployMapper() { + return MapperProxyFactory.getProxy(EmployMapper.class); + } + + private TaxAgentMapper getTaxAgentMapper() { + return MapperProxyFactory.getProxy(TaxAgentMapper.class); + } + + private InsuranceSchemeMapper getInsuranceSchemeMapper() { + return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class); + } + @Override public List> buildCommonRecords(List list, Long employeeId) { List> result = new ArrayList<>(); @@ -48,12 +61,12 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ List employeeByIds = new ArrayList<>(); List> partition = Lists.partition(employeeIds, 1000); for (List longs : partition) { - employeeByIds.addAll(MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeByIdsAll(longs)); + employeeByIds.addAll(getEmployMapper().getEmployeeByIdsAll(longs)); } if (CollectionUtils.isEmpty(employeeByIds)) { return result; } - List paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); + List paymentList = getTaxAgentMapper().listAll(); SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(100341, "暂无扣缴义务人")); Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity())); @@ -75,7 +88,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ record.put("socialPayOrg", paymentMap.get(item.getSocialPayOrg()) == null ? "" : paymentMap.get(item.getSocialPayOrg()).getName()); record.put("socialAccount", item.getSocialAccount()); - record.put("socialSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(item.getSocialSchemeId())); + record.put("socialSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getSocialSchemeId())); if (StringUtils.isNotEmpty(item.getSocialPaymentBaseString())) { Map socialJson = JSON.parseObject(item.getSocialPaymentBaseString(), new HashMap().getClass()); if(socialJson!=null){ @@ -86,7 +99,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ } record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getFundPayOrg(),TaxAgentPO.builder().build())).getName()); record.put("fundAccount", item.getFundAccount()); - record.put("fundSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(item.getFundSchemeId())); + 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()); @@ -97,7 +110,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ } } record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getOtherPayOrg(),TaxAgentPO.builder().build())).getName()); - record.put("otherSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(item.getOtherSchemeId())); + record.put("otherSchemeName", getInsuranceSchemeMapper().querySchemeName(item.getOtherSchemeId())); if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) { Map socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); if(socialJson!=null){ @@ -195,7 +208,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ List employeeByIds = new ArrayList<>(); List> partition = Lists.partition(employeeIds, 1000); for (List longs : partition) { - employeeByIds.addAll(MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeByIdsAll(longs)); + employeeByIds.addAll(getEmployMapper().getEmployeeByIdsAll(longs)); } if (CollectionUtils.isEmpty(employeeByIds)) { return result; @@ -217,7 +230,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ record.put("employeeStatus", simpleEmployee.getStatus()); InsuranceArchivesSocialSchemePO social = insuranceAccountInspectPO.getSocial(); if (social != null) { - record.put("socialSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(social.getSocialSchemeId())); + record.put("socialSchemeName", getInsuranceSchemeMapper().querySchemeName(social.getSocialSchemeId())); if (StringUtils.isNotEmpty(social.getSocialPaymentBaseString())) { Map socialJson = JSON.parseObject(social.getSocialPaymentBaseString(), new HashMap().getClass()); socialJson.forEach((k, v) -> { @@ -227,7 +240,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ } InsuranceArchivesFundSchemePO fund = insuranceAccountInspectPO.getFund(); if (fund != null) { - record.put("fundSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(fund.getFundSchemeId())); + record.put("fundSchemeName", getInsuranceSchemeMapper().querySchemeName(fund.getFundSchemeId())); if (StringUtils.isNotEmpty(fund.getFundPaymentBaseString())) { Map socialJson = JSON.parseObject(fund.getFundPaymentBaseString(), new HashMap().getClass()); socialJson.forEach((k, v) -> { @@ -237,7 +250,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ } InsuranceArchivesOtherSchemePO other = insuranceAccountInspectPO.getOther(); if (other != null) { - record.put("otherSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(other.getOtherSchemeId())); + record.put("otherSchemeName", getInsuranceSchemeMapper().querySchemeName(other.getOtherSchemeId())); if (StringUtils.isNotEmpty(other.getOtherPaymentBaseString())) { Map socialJson = JSON.parseObject(other.getOtherPaymentBaseString(), new HashMap().getClass()); socialJson.forEach((k, v) -> { diff --git a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java index f5fc62819..c2e813437 100644 --- a/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAComparisonResultServiceImpl.java @@ -53,6 +53,10 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + private ICategoryMapper getICategoryMapper() { + return MapperProxyFactory.getProxy(ICategoryMapper.class); + } + /** * 根据列表查询条件查询线下对比结果(分页) */ @@ -181,7 +185,7 @@ public class SIAComparisonResultServiceImpl extends Service implements SIACompar Set info = new HashSet<>(); - List listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); + List listAll = getICategoryMapper().listAll(); List socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1).collect(Collectors.toList()); List fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2).collect(Collectors.toList()); List otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3).collect(Collectors.toList()); diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 86dbc3a69..6e0c439e5 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -176,6 +176,14 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { private TaxAgentBiz taxAgentBiz = new TaxAgentBiz(); + private ICategoryMapper getICategoryMapper() { + return MapperProxyFactory.getProxy(ICategoryMapper.class); + } + + private InsuranceAccountInspectMapper getInsuranceAccountInspectMapper() { + return MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class); + } + @Override public Map listPage(InsuranceAccountBatchParam queryParam) { Long employeeId = (long) user.getUID(); @@ -579,7 +587,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public void unconfirmed(Collection ids) { - List insuranceAccountInspectPOS = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByInspectStatusAndIds(InspectStatusEnum.COMFORED.getValue(), ids); + List insuranceAccountInspectPOS = getInsuranceAccountInspectMapper().getByInspectStatusAndIds(InspectStatusEnum.COMFORED.getValue(), ids); if (CollectionUtils.isNotEmpty(insuranceAccountInspectPOS)) { getInsuranceAccountDetailMapper().batchUnConfirmedInspectDetails(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getId).collect(Collectors.toList())); @@ -590,7 +598,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public Map buttonCheck(String billMonth) { Map result = new HashMap<>(); - List list = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByInspectStatusAndBillMonth(InspectStatusEnum.IGNORE.getValue(), billMonth); + List list = getInsuranceAccountInspectMapper().getByInspectStatusAndBillMonth(InspectStatusEnum.IGNORE.getValue(), billMonth); if (CollectionUtils.isEmpty(list)) { result.put("displayFlag", false); return result; @@ -601,7 +609,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public void ignore(Collection ids) { - List insuranceAccountInspectPOS = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByInspectStatusAndIds(InspectStatusEnum.IGNORE.getValue(), ids); + List insuranceAccountInspectPOS = getInsuranceAccountInspectMapper().getByInspectStatusAndIds(InspectStatusEnum.IGNORE.getValue(), ids); if (CollectionUtils.isNotEmpty(insuranceAccountInspectPOS)) { getInsuranceAccountDetailMapper().batchIgnoreInspectDetails(insuranceAccountInspectPOS.stream().map(InsuranceAccountInspectPO::getId).collect(Collectors.toList())); @@ -723,7 +731,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { public Map getInspectTable(InsuranceAccountDetailParam param) { Map datas = new HashMap<>(); - List insuranceAccountInspectPOS = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class).getByBillMonth(param.getBillMonth()); + List insuranceAccountInspectPOS = getInsuranceAccountInspectMapper().getByBillMonth(param.getBillMonth()); List> records = getService(user).buildInspectRecords(insuranceAccountInspectPOS, Long.valueOf(param.getPaymentOrganization())); List> paged = SalaryPageUtil.subList(param.getCurrent(), param.getPageSize(), records); PageInfo> pageInfos = new PageInfo<>(paged); @@ -910,7 +918,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public Map welfareColumns() { - List listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); + List listAll = getICategoryMapper().listAll(); List list = new ArrayList<>(); if (CollectionUtils.isNotEmpty(listAll)) { list.addAll(listAll); @@ -1159,8 +1167,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public List allInspects(Collection ids, String billMonth) { - InsuranceAccountInspectMapper siAccountInspectMapper = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class); - List list = siAccountInspectMapper.getList(billMonth, InspectStatusEnum.IGNORE.getValue(), ids); +// InsuranceAccountInspectMapper siAccountInspectMapper = MapperProxyFactory.getProxy(InsuranceAccountInspectMapper.class); + List list = getInsuranceAccountInspectMapper().getList(billMonth, InspectStatusEnum.IGNORE.getValue(), ids); if (CollectionUtils.isNotEmpty(list)) { return list; } @@ -1819,7 +1827,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { @Override public XSSFWorkbook exportComparisonWelfareTemplate(InsuranceAcctDetailImportTemplateParam param) { - List listAll = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); + List listAll = getICategoryMapper().listAll(); List socialWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 1).collect(Collectors.toList()); List fundWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 2).collect(Collectors.toList()); List otherWelfareList = listAll.stream().filter(e -> e.getWelfareType() == 3).collect(Collectors.toList()); @@ -2611,7 +2619,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // 获取租户下所有的人员 List salaryEmployees = employBiz.listEmployee(); - List insuranceCategoryPOS = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); + List insuranceCategoryPOS = getICategoryMapper().listAll(); // 失败的数量 int failCount = 0; // 成功的数量 diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index 9e8870691..1c50902ac 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -530,11 +530,11 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService if (needAuth) { List taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployee(currentEmployeeId); Set employeeIds = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, TaxAgentEmployeeDTO::getEmployeeId); - List list = MapperProxyFactory.getProxy(SocialSchemeMapper.class).queryEmployeeList(param); + List list = getSocialSchemeMapper().queryEmployeeList(param); return list.stream().filter(f -> employeeIds.contains(f.getEmployeeId())).collect(Collectors.toList()); } - return MapperProxyFactory.getProxy(SocialSchemeMapper.class).queryEmployeeList(param); + return getSocialSchemeMapper().queryEmployeeList(param); } /** diff --git a/src/com/engine/salary/service/impl/SICategoryServiceImpl.java b/src/com/engine/salary/service/impl/SICategoryServiceImpl.java index 8c27080b6..b967813a0 100644 --- a/src/com/engine/salary/service/impl/SICategoryServiceImpl.java +++ b/src/com/engine/salary/service/impl/SICategoryServiceImpl.java @@ -72,7 +72,7 @@ public class SICategoryServiceImpl extends Service implements SICategoryService @Override public Map categoryIdNameMap() { //系统福利类型 - Map systemAndCustomMap = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll().stream() + Map systemAndCustomMap = getICategoryMapper().listAll().stream() .collect(Collectors.toMap(ICategoryPO::getId, ICategoryPO::getInsuranceName)); HashMap total = new HashMap<>(); if (MapUtils.isNotEmpty(systemAndCustomMap)) { diff --git a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java index 3130377dc..e237ea7f4 100644 --- a/src/com/engine/salary/service/impl/SICompensationServiceImpl.java +++ b/src/com/engine/salary/service/impl/SICompensationServiceImpl.java @@ -80,6 +80,10 @@ public class SICompensationServiceImpl extends Service implements SICompensation return ServiceUtil.getService(ColumnBuildServiceImpl.class, user); } + private ICategoryMapper getICategoryMapper() { + return MapperProxyFactory.getProxy(ICategoryMapper.class); + } + /** * 可调差人员 */ @@ -504,7 +508,7 @@ public class SICompensationServiceImpl extends Service implements SICompensation List allEmployees = getEmployMapper().listAll(); Map usernameMap = SalaryEntityUtil.convert2Map(allEmployees, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername); - List allCategoryList = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); + List allCategoryList = getICategoryMapper().listAll(); Map categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName); boolean haveCompensation = compensationPOList != null && compensationPOList.size() > 0; diff --git a/src/com/engine/salary/service/impl/SIExportServiceImpl.java b/src/com/engine/salary/service/impl/SIExportServiceImpl.java index a15937931..9faa7fd87 100644 --- a/src/com/engine/salary/service/impl/SIExportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIExportServiceImpl.java @@ -90,6 +90,10 @@ public class SIExportServiceImpl extends Service implements SIExportService { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } + private ICategoryMapper getICategoryMapper() { + return MapperProxyFactory.getProxy(ICategoryMapper.class); + } + @Override public XSSFWorkbook exportOverView(InsuranceExportParam queryParam) { List insuranceAccountDetailPOS = getInsuranceAccountDetailMapper().selectList(queryParam.getBillMonth(), StringUtils.isBlank(queryParam.getPaymentOrganization()) ? null : Long.valueOf(queryParam.getPaymentOrganization())); @@ -206,7 +210,7 @@ public class SIExportServiceImpl extends Service implements SIExportService { private List> buildCommonRecords(List list) { List> result = new ArrayList<>(); - List paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); + List paymentList = getTaxAgentMapper().listAll(); SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(100341, "该租户无扣缴义务人")); Map schemeIdNameMap = getSISchemeService(user).getSchemeIdNameMap(); Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity())); @@ -529,9 +533,9 @@ public class SIExportServiceImpl extends Service implements SIExportService { private Map categoryIdNameMap() { //系统福利类型 - Map systemMap = MapperProxyFactory.getProxy(ICategoryMapper.class).listByDataType(DataTypeEnum.SYSTEM.getValue()).stream() + Map systemMap = getICategoryMapper().listByDataType(DataTypeEnum.SYSTEM.getValue()).stream() .collect(Collectors.toMap(ICategoryPO::getId, ICategoryPO::getInsuranceName)); - Map customMap = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll() + Map customMap = getICategoryMapper().listAll() .stream().collect(Collectors.toMap(ICategoryPO::getId, ICategoryPO::getInsuranceName)); HashMap total = new HashMap<>(); if (MapUtils.isNotEmpty(systemMap)) { diff --git a/src/com/engine/salary/service/impl/SIImportServiceImpl.java b/src/com/engine/salary/service/impl/SIImportServiceImpl.java index 8315e6677..4a5ffae54 100644 --- a/src/com/engine/salary/service/impl/SIImportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIImportServiceImpl.java @@ -55,6 +55,18 @@ public class SIImportServiceImpl extends Service implements SIImportService { return ServiceUtil.getService(SIArchivesServiceImpl.class,user); } + private ICategoryMapper getICategoryMapper() { + return MapperProxyFactory.getProxy(ICategoryMapper.class); + } + + private TaxAgentMapper getTaxAgentMapper() { + return MapperProxyFactory.getProxy(TaxAgentMapper.class); + } + + private InsuranceSchemeMapper getInsuranceSchemeMapper() { + return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class); + } + @Override public XSSFWorkbook exportTemplate(InsuranceArchivesListParam param) { //工作簿list @@ -213,11 +225,11 @@ public class SIImportServiceImpl extends Service implements SIImportService { * @return */ public Map welfareNameIdMap(WelfareTypeEnum welfareTypeEnum) { - return MapperProxyFactory.getProxy(ICategoryMapper.class).listByWelfareType(welfareTypeEnum.getValue(),null).stream().collect(Collectors.toMap(ICategoryPO::getInsuranceName, ICategoryPO::getId)); + return getICategoryMapper().listByWelfareType(welfareTypeEnum.getValue(),null).stream().collect(Collectors.toMap(ICategoryPO::getInsuranceName, ICategoryPO::getId)); } public Map welfareMap() { - return MapperProxyFactory.getProxy(ICategoryMapper.class).listAll().stream().collect(Collectors.toMap(ICategoryPO::getId, ICategoryPO::getInsuranceName)); + return getICategoryMapper().listAll().stream().collect(Collectors.toMap(ICategoryPO::getId, ICategoryPO::getInsuranceName)); } /** @@ -226,7 +238,7 @@ public class SIImportServiceImpl extends Service implements SIImportService { * @return */ public Map paymentOrganizationIdNameMap() { - List list = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); + List list = getTaxAgentMapper().listAll(); if (CollectionUtils.isEmpty(list)) { return new HashMap<>(); } @@ -241,7 +253,7 @@ public class SIImportServiceImpl extends Service implements SIImportService { Map paymentMap = paymentOrganizationIdNameMap(); //获取id,方案名称的map,用于下面组装福利数据 Map schemeMap = new HashMap<>(); - List schemeList = MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).listAll(); + List schemeList = getInsuranceSchemeMapper().listAll(); if (CollectionUtils.isNotEmpty(schemeList)) { schemeMap = schemeList.stream().collect(Collectors.toMap(InsuranceSchemePO::getId, InsuranceSchemePO::getSchemeName)); } diff --git a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java index e4b65f6be..401461d57 100644 --- a/src/com/engine/salary/service/impl/SIRepairServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIRepairServiceImpl.java @@ -51,6 +51,10 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { return MapperProxyFactory.getProxy(OtherSchemeMapper.class); } + private ICategoryMapper getICategoryMapper() { + return MapperProxyFactory.getProxy(ICategoryMapper.class); + } + /** * 获取指定月份的福利缴纳基数作为补缴基数 * @param param @@ -84,7 +88,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { Map targetBaseMap = new HashMap<>(); - List allCategoryList = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); + List allCategoryList = getICategoryMapper().listAll(); Map categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName); Map welfareTypeMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getWelfareType); @@ -107,7 +111,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { } if (!projects.contains(ProjectTypeEnum.SOCIAL.getValue())) { - List list = MapperProxyFactory.getProxy(ICategoryMapper.class).listByDataType(DataTypeEnum.SYSTEM.getValue()); + List list = getICategoryMapper().listByDataType(DataTypeEnum.SYSTEM.getValue()); if (projects.contains(ProjectTypeEnum.ENDOWMENT_INSURANCE.getValue())) { ICategoryPO insuranceCategoryPO = list.stream().filter(item -> SalaryI18nUtil.getI18nLabel(93113, "养老保险").equals(item.getInsuranceName())).findFirst() @@ -202,7 +206,7 @@ public class SIRepairServiceImpl extends Service implements SIRepairService { otherSchemePO = otherSchemePOList.get(0); } - List allCategoryList = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); + List allCategoryList = getICategoryMapper().listAll(); Map categoryNameMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getInsuranceName); Map welfareTypeMap = SalaryEntityUtil.convert2Map(allCategoryList, ICategoryPO::getId, ICategoryPO::getWelfareType); diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index fa7a46414..0e91bce27 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -434,12 +434,12 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { } public Collection queryInsuranceSchemeDetailList(Long id) { - List insuranceSchemeDetailPOS = MapperProxyFactory.getProxy(InsuranceSchemeDetailMapper.class).queryInsuranceSchemeDetailList(id, IsPaymentEnum.YES.getValue()); + List insuranceSchemeDetailPOS = getInsuranceSchemeDetailMapper().queryInsuranceSchemeDetailList(id, IsPaymentEnum.YES.getValue()); return encryptUtil.decryptList(insuranceSchemeDetailPOS, InsuranceSchemeDetailPO.class); } public String queryInsuranceName(Long id) { - ICategoryPO insuranceCategoryPO = MapperProxyFactory.getProxy(ICategoryMapper.class).getById(id); + ICategoryPO insuranceCategoryPO = getICategoryMapper().getById(id); return insuranceCategoryPO == null ? "" : Objects.isNull(insuranceCategoryPO.getInsuranceName()) ? "" : insuranceCategoryPO.getInsuranceName(); } diff --git a/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java b/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java index c6e8745fa..49d436d52 100644 --- a/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryFormulaWrapper.java @@ -58,6 +58,10 @@ public class SalaryFormulaWrapper extends Service { private SalaryItemBiz salaryItemBiz = new SalaryItemBiz(); + private ICategoryMapper getICategoryMapper() { + return MapperProxyFactory.getProxy(ICategoryMapper.class); + } + /** * 公式字段列表 * @@ -132,7 +136,7 @@ public class SalaryFormulaWrapper extends Service { List welfareList = welfareList(); welfareList = welfareList.stream().filter(f -> !f.getSalaryItemName().contains("合计")).collect(Collectors.toList()); - List noUseICategoryList= MapperProxyFactory.getProxy(ICategoryMapper.class).listAll().stream().filter(f -> f.getIsUse() == 0).collect(Collectors.toList()); + List noUseICategoryList= getICategoryMapper().listAll().stream().filter(f -> f.getIsUse() == 0).collect(Collectors.toList()); if (noUseICategoryList.size() > 0) { List noUseNameList = noUseICategoryList.stream().map(ICategoryPO::getInsuranceName).collect(Collectors.toList()); welfareList = welfareList.stream().filter(f -> !noUseNameList.contains(f.getSalaryItemName().substring(0, f.getSalaryItemName().length() - 2))).collect(Collectors.toList());