From 65cfe6c28a3c29c3af541b39688df2d3c76224cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 9 Aug 2022 16:54:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=97=A0=E6=95=88=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/SIAccountBiz.java | 10 +- src/com/engine/salary/biz/TaxAgentBiz.java | 12 +- .../siaccount/bo/InsuranceAccountBO.java | 2 +- .../engine/salary/mapper/TaxAgentMapper.java | 62 ------ .../engine/salary/mapper/TaxAgentMapper.xml | 181 ------------------ .../service/impl/RecordsBuildServiceImpl.java | 12 +- .../service/impl/SIExportServiceImpl.java | 15 +- .../service/impl/SIImportServiceImpl.java | 8 +- 8 files changed, 29 insertions(+), 273 deletions(-) delete mode 100644 src/com/engine/salary/mapper/TaxAgentMapper.java delete mode 100644 src/com/engine/salary/mapper/TaxAgentMapper.xml diff --git a/src/com/engine/salary/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index 0b98866a9..d1f463b91 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -26,15 +26,15 @@ import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO; import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.entity.sischeme.po.InsuranceSchemeDetailPO; -import com.engine.salary.entity.taxrate.TaxAgent; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.siaccount.*; import com.engine.salary.enums.sicategory.*; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.mapper.TaxAgentMapper; import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.siaccount.*; import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; @@ -1505,9 +1505,9 @@ public class SIAccountBiz extends Service { InsuranceAccountDetailPOEncrypt.decryptInsuranceAccountDetailPOList(insuranceAccountDetailPOS); //获取扣缴义务人信息 - List paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); + List paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(100341, "该租户无扣缴义务人")); - Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgent::getId, Function.identity())); + Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity())); List insuranceAccountViewListDTOS = buildRecords(insuranceAccountDetailPOS, paymentMap); // List iCategoryPOS = MapperProxyFactory.getProxy(ICategoryMapper.class).listAll(); @@ -1520,7 +1520,7 @@ public class SIAccountBiz extends Service { return insuranceAccountViewListDTOPage; } - public List buildRecords(List list, Map paymentMap) { + public List buildRecords(List list, Map paymentMap) { Map result = new HashMap<>(); //根据组织分组,对社保进行统计 Map> socialCollect = list.stream().filter(item -> item.getSocialPayOrg() != null) diff --git a/src/com/engine/salary/biz/TaxAgentBiz.java b/src/com/engine/salary/biz/TaxAgentBiz.java index 4a5ef5b3a..96ba7fb23 100644 --- a/src/com/engine/salary/biz/TaxAgentBiz.java +++ b/src/com/engine/salary/biz/TaxAgentBiz.java @@ -1,8 +1,8 @@ package com.engine.salary.biz; -import com.engine.salary.entity.taxrate.TaxAgent; -import com.engine.salary.entity.taxrate.param.TaxAgentQueryParam; -import com.engine.salary.mapper.TaxAgentMapper; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; import org.apache.ibatis.session.SqlSession; import weaver.conn.mybatis.MyBatisFactory; @@ -11,7 +11,7 @@ import java.util.List; public class TaxAgentBiz { - public List listAll() { + public List listAll() { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { TaxAgentMapper taxAgentMapper = sqlSession.getMapper(TaxAgentMapper.class); @@ -21,7 +21,7 @@ public class TaxAgentBiz { } } - public List listByIds(Collection taxAgentIds) { + public List listByIds(Collection taxAgentIds) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { TaxAgentMapper taxAgentMapper = sqlSession.getMapper(TaxAgentMapper.class); @@ -31,7 +31,7 @@ public class TaxAgentBiz { } } - public TaxAgent getById(Long taxAgentId) { + public TaxAgentPO getById(Long taxAgentId) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { TaxAgentMapper taxAgentMapper = sqlSession.getMapper(TaxAgentMapper.class); diff --git a/src/com/engine/salary/entity/siaccount/bo/InsuranceAccountBO.java b/src/com/engine/salary/entity/siaccount/bo/InsuranceAccountBO.java index aa39ab226..50424df48 100644 --- a/src/com/engine/salary/entity/siaccount/bo/InsuranceAccountBO.java +++ b/src/com/engine/salary/entity/siaccount/bo/InsuranceAccountBO.java @@ -4,7 +4,7 @@ package com.engine.salary.entity.siaccount.bo; import com.engine.salary.entity.siaccount.dto.InsuranceAccountBatchListDTO; import com.engine.salary.entity.siaccount.po.InsuranceAccountBatchPO; import com.engine.salary.enums.siaccount.BillStatusEnum; -import com.engine.salary.mapper.TaxAgentMapper; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryEnumUtil; import com.engine.salary.util.db.MapperProxyFactory; diff --git a/src/com/engine/salary/mapper/TaxAgentMapper.java b/src/com/engine/salary/mapper/TaxAgentMapper.java deleted file mode 100644 index e43dd4bcf..000000000 --- a/src/com/engine/salary/mapper/TaxAgentMapper.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.engine.salary.mapper; - -import com.engine.salary.entity.taxrate.TaxAgent; -import com.engine.salary.entity.taxrate.param.TaxAgentQueryParam; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -public interface TaxAgentMapper { - - /** - * 查询所有记录 - * - * @return 返回集合,没有返回空List - */ - List listAll(); - - - /** - * 根据主键查询 - * - * @param id 主键 - * @return 返回记录,没有返回null - */ - TaxAgent getById(Long id); - - /** - * 新增,插入所有字段 - * - * @param taxAgent 新增的记录 - * @return 返回影响行数 - */ - int insert(TaxAgent taxAgent); - - /** - * 新增,忽略null字段 - * - * @param taxAgent 新增的记录 - * @return 返回影响行数 - */ - int insertIgnoreNull(TaxAgent taxAgent); - - - /** - * 条件查询 - * @param taxAgent - * @return - */ - List listBySome(@Param("param") TaxAgentQueryParam taxAgent); - - - /** - * 根据名称查询 - * @param name - * @return - */ - @Select("SELECT * FROM hrsa_tax_agent WHERE delete_type = 0 and name = #{name}") - List listByName(String name); - - -} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/TaxAgentMapper.xml b/src/com/engine/salary/mapper/TaxAgentMapper.xml deleted file mode 100644 index 9405c1f0f..000000000 --- a/src/com/engine/salary/mapper/TaxAgentMapper.xml +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - - - - - - - - - - t.create_time - , t.creator - , t.delete_type - , t.description - , t.id - , t.name - , t.tenant_key - , t.update_time - - - - - AND id IN - - #{id} - - - - AND name like CONCAT('%',#{param.name},'%') - - - - - - - - - - - - - - - INSERT INTO hrsa_tax_agent - - create_time, - creator, - delete_type, - description, - id, - name, - tenant_key, - update_time, - - - #{createTime}, - #{creator}, - #{deleteType}, - #{description}, - #{id}, - #{name}, - #{tenantKey}, - #{updateTime}, - - - - - - select hrsa_tax_agent_id.currval from dual - - INSERT INTO hrsa_tax_agent - - create_time, - creator, - delete_type, - description, - id, - name, - tenant_key, - update_time, - - - #{createTime}, - #{creator}, - #{deleteType}, - #{description}, - #{id}, - #{name}, - #{tenantKey}, - #{updateTime}, - - - - - - INSERT INTO hrsa_tax_agent - - - - create_time, - - - creator, - - - delete_type, - - - description, - - - id, - - - name, - - - tenant_key, - - - update_time, - - - - - #{createTime}, - - - #{creator}, - - - #{deleteType}, - - - #{description}, - - - #{id}, - - - #{name}, - - - #{tenantKey}, - - - #{updateTime}, - - - - - - - \ No newline at end of file diff --git a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java index 2b6c58969..01557227d 100644 --- a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java @@ -10,13 +10,13 @@ import com.engine.salary.entity.siarchives.po.InsuranceArchivesAccountPO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesFundSchemePO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO; -import com.engine.salary.entity.taxrate.TaxAgent; +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.mapper.TaxAgentMapper; import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.RecordsBuildService; import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; @@ -53,10 +53,10 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ if (CollectionUtils.isEmpty(employeeByIds)) { return result; } - List paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); + List paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(100341, "暂无扣缴义务人")); - Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgent::getId, Function.identity())); + Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity())); Map collect = employeeByIds.stream().collect(Collectors.toMap(DataCollectionEmployee::getEmployeeId, Function.identity())); list.forEach(item -> { Map record = new HashMap<>(); @@ -84,7 +84,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ }); } } - record.put("fundPayOrg", item.getFundPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getFundPayOrg(),TaxAgent.builder().build())).getName()); + 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("supplementFundAccount", item.getSupplementFundAccount()); @@ -96,7 +96,7 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ }); } } - record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getOtherPayOrg(),TaxAgent.builder().build())).getName()); + record.put("otherPayOrg", item.getOtherPayOrg() == null ? "" : (paymentMap.getOrDefault(item.getOtherPayOrg(),TaxAgentPO.builder().build())).getName()); record.put("otherSchemeName", MapperProxyFactory.getProxy(InsuranceSchemeMapper.class).querySchemeName(item.getOtherSchemeId())); if (StringUtils.isNotEmpty(item.getOtherPaymentBaseString())) { Map socialJson = JSON.parseObject(item.getOtherPaymentBaseString(), new HashMap().getClass()); diff --git a/src/com/engine/salary/service/impl/SIExportServiceImpl.java b/src/com/engine/salary/service/impl/SIExportServiceImpl.java index d62253b94..7499a0d09 100644 --- a/src/com/engine/salary/service/impl/SIExportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIExportServiceImpl.java @@ -2,6 +2,7 @@ package com.engine.salary.service.impl; import com.alibaba.fastjson.JSON; 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.encrypt.siaccount.InsuranceAccountDetailPOEncrypt; @@ -11,16 +12,16 @@ import com.engine.salary.entity.siaccount.po.InsuranceAccountDetailPO; import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.entity.siexport.param.InsuranceExportParam; import com.engine.salary.entity.siexport.po.AccountExportPO; -import com.engine.salary.entity.taxrate.TaxAgent; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; 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.WelfareTypeEnum; import com.engine.salary.mapper.InsuranceExportMapper; -import com.engine.salary.mapper.TaxAgentMapper; import com.engine.salary.mapper.siaccount.InsuranceAccountDetailMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SIExportService; import com.engine.salary.service.SISchemeService; import com.engine.salary.util.SalaryAssert; @@ -32,8 +33,6 @@ import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import weaver.hrm.User; -import com.engine.common.util.ServiceUtil; - import java.util.*; import java.util.function.Function; @@ -62,9 +61,9 @@ public class SIExportServiceImpl extends Service implements SIExportService { InsuranceAccountDetailPOEncrypt.decryptInsuranceAccountDetailPOList(insuranceAccountDetailPOS); //获取扣缴义务人信息 - List paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); + List paymentList = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(100341, "该租户无扣缴义务人")); - Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgent::getId, Function.identity())); + Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity())); List insuranceAccountViewListDTOS = siAccountBiz.buildRecords(insuranceAccountDetailPOS, paymentMap); List> excelSheetData = new ArrayList<>(); @@ -136,10 +135,10 @@ 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 = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); SalaryAssert.notEmpty(paymentList, SalaryI18nUtil.getI18nLabel(100341, "该租户无扣缴义务人")); Map schemeIdNameMap = getSISchemeService(user).getSchemeIdNameMap(); - Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgent::getId, Function.identity())); + Map paymentMap = paymentList.stream().collect(Collectors.toMap(TaxAgentPO::getId, Function.identity())); list.forEach(item -> { Map record = new HashMap<>(); record.put("billMonth", item.getBillMonth()); diff --git a/src/com/engine/salary/service/impl/SIImportServiceImpl.java b/src/com/engine/salary/service/impl/SIImportServiceImpl.java index 48af41e32..ea9a39179 100644 --- a/src/com/engine/salary/service/impl/SIImportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIImportServiceImpl.java @@ -16,12 +16,12 @@ import com.engine.salary.entity.siarchives.po.InsuranceArchivesOtherSchemePO; import com.engine.salary.entity.siarchives.po.InsuranceArchivesSocialSchemePO; import com.engine.salary.entity.sicategory.po.ICategoryPO; import com.engine.salary.entity.sischeme.po.InsuranceSchemePO; -import com.engine.salary.entity.taxrate.TaxAgent; +import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.sicategory.WelfareTypeEnum; -import com.engine.salary.mapper.TaxAgentMapper; import com.engine.salary.mapper.siarchives.SocialSchemeMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SIArchivesService; import com.engine.salary.service.SIImportService; import com.engine.salary.util.SalaryI18nUtil; @@ -208,11 +208,11 @@ public class SIImportServiceImpl extends Service implements SIImportService { * @return */ public Map paymentOrganizationIdNameMap() { - List list = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); + List list = MapperProxyFactory.getProxy(TaxAgentMapper.class).listAll(); if (CollectionUtils.isEmpty(list)) { return new HashMap<>(); } - return list.stream().collect(Collectors.toMap(TaxAgent::getId, TaxAgent::getName)); + return list.stream().collect(Collectors.toMap(TaxAgentPO::getId, TaxAgentPO::getName)); } public List> buildTableData(List insuranceArchivesEmployeePOS) {