From 6a42f1c7c6e92ae744f57b8a9905d45c4e986dc3 Mon Sep 17 00:00:00 2001 From: liuliang <401809302@qq.com> Date: Tue, 2 Aug 2022 17:57:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/engine/salary/biz/EmployBiz.java | 23 ++++++++++++++++--- .../service/impl/RecordsBuildServiceImpl.java | 13 +++++++++-- .../service/impl/SIImportServiceImpl.java | 13 +++++++++-- .../service/impl/SISchemeServiceImpl.java | 17 +++++++++++--- .../impl/SalaryEmployeeServiceImpl.java | 8 ++++++- 5 files changed, 63 insertions(+), 11 deletions(-) diff --git a/src/com/engine/salary/biz/EmployBiz.java b/src/com/engine/salary/biz/EmployBiz.java index 338738087..3f0784c1d 100644 --- a/src/com/engine/salary/biz/EmployBiz.java +++ b/src/com/engine/salary/biz/EmployBiz.java @@ -6,10 +6,12 @@ import com.engine.salary.entity.hrm.PositionInfo; import com.engine.salary.entity.hrm.SubCompanyInfo; import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.mapper.datacollection.EmployMapper; +import com.google.common.collect.Lists; import org.apache.ibatis.session.SqlSession; import weaver.conn.mybatis.MyBatisFactory; import weaver.general.BaseBean; +import java.util.ArrayList; import java.util.List; public class EmployBiz extends BaseBean { @@ -32,8 +34,13 @@ public class EmployBiz extends BaseBean { public List getEmployeeByIds(List list) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { + List dataList = new ArrayList<>(); EmployMapper mapper = sqlSession.getMapper(EmployMapper.class); - return mapper.getEmployeeByIds(list); + List> partition = Lists.partition(list, 1000); + for (List longs : partition) { + dataList.addAll(mapper.getEmployeeByIds(longs)); + } + return dataList; } finally { sqlSession.close(); } @@ -43,8 +50,13 @@ public class EmployBiz extends BaseBean { public List getEmployeeByIdsAll(List list) { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { + List employeeList = new ArrayList<>(); EmployMapper mapper = sqlSession.getMapper(EmployMapper.class); - return mapper.getEmployeeByIdsAll(list); + List> partition = Lists.partition(list, 1000); + for (List longs : partition) { + employeeList.addAll(mapper.getEmployeeByIdsAll(longs)); + } + return employeeList; } finally { sqlSession.close(); } @@ -54,7 +66,12 @@ public class EmployBiz extends BaseBean { SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); try { EmployMapper mapper = sqlSession.getMapper(EmployMapper.class); - return mapper.getAdminEmployeeByIds(list); + List employeeList = Lists.newArrayList(); + List> partition = Lists.partition(list, 1000); + for (List longs : partition) { + employeeList.addAll(mapper.getAdminEmployeeByIds(longs)); + } + return employeeList; } finally { sqlSession.close(); } diff --git a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java index 963b1c8d4..2b6c58969 100644 --- a/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java +++ b/src/com/engine/salary/service/impl/RecordsBuildServiceImpl.java @@ -20,6 +20,7 @@ import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; import com.engine.salary.service.RecordsBuildService; import com.engine.salary.util.*; import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -44,7 +45,11 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ return result; } List employeeIds = list.stream().map(item -> item.getEmployeeId()).collect(Collectors.toList()); - List employeeByIds = MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeByIdsAll(employeeIds); + List employeeByIds = new ArrayList<>(); + List> partition = Lists.partition(employeeIds, 1000); + for (List longs : partition) { + employeeByIds.addAll(MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeByIdsAll(longs)); + } if (CollectionUtils.isEmpty(employeeByIds)) { return result; } @@ -187,7 +192,11 @@ public class RecordsBuildServiceImpl extends Service implements RecordsBuildServ return result; } List employeeIds = list.stream().map(InsuranceAccountInspectPO::getEmployeeId).collect(Collectors.toList()); - List employeeByIds = MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeByIdsAll(employeeIds); + List employeeByIds = new ArrayList<>(); + List> partition = Lists.partition(employeeIds, 1000); + for (List longs : partition) { + employeeByIds.addAll(MapperProxyFactory.getProxy(EmployMapper.class).getEmployeeByIdsAll(longs)); + } if (CollectionUtils.isEmpty(employeeByIds)) { return result; } diff --git a/src/com/engine/salary/service/impl/SIImportServiceImpl.java b/src/com/engine/salary/service/impl/SIImportServiceImpl.java index c80e83a81..d7b1ca7b4 100644 --- a/src/com/engine/salary/service/impl/SIImportServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIImportServiceImpl.java @@ -26,6 +26,7 @@ import com.engine.salary.service.SIArchivesService; import com.engine.salary.service.SIImportService; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; +import com.engine.salary.util.excel.ExcelComment; import com.engine.salary.util.excel.ExcelUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -129,8 +130,16 @@ public class SIImportServiceImpl extends Service implements SIImportService { } // 3.表数据 + + // 4.注释 + List excelComments = Lists.newArrayList(); + excelComments.add(new ExcelComment(0, 0, 3, 2, SalaryI18nUtil.getI18nLabel(100344, "必填"))); + excelComments.add(new ExcelComment(4, 0, 5, 2, SalaryI18nUtil.getI18nLabel(100344, "必填"))); + excelComments.add(new ExcelComment(5, 0, 6, 2, SalaryI18nUtil.getI18nLabel(100344, "社保,公积金,其他福利方案名称不可同时为空"))); + + //工作簿数据 - return ExcelUtil.genWorkbookV2(excelSheetData, sheetName); + return ExcelUtil.genWorkbookV2(excelSheetData, sheetName,excelComments); } @@ -145,9 +154,9 @@ public class SIImportServiceImpl extends Service implements SIImportService { result.add(SalaryI18nUtil.getI18nLabel( 86185, "部门")); result.add(SalaryI18nUtil.getI18nLabel( 86186, "手机号")); result.add(SalaryI18nUtil.getI18nLabel( 86187, "员工状态")); + result.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); result.add(SalaryI18nUtil.getI18nLabel( 91323, "社保方案名称")); // result.add(SalaryI18nUtil.getI18nLabel( 91325, "社保缴纳组织")); - result.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人")); //社保福利基数 Map socialMap = welfareNameIdMap( WelfareTypeEnum.SOCIAL_SECURITY); socialMap.forEach((k, v) -> result.add(k + SalaryI18nUtil.getI18nLabel( 100293, "申报基数"))); diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 7ce0c5d94..9eb301f1a 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -34,6 +34,7 @@ import com.engine.salary.mapper.siarchives.SocialSchemeMapper; import com.engine.salary.mapper.sicategory.ICategoryMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeDetailMapper; import com.engine.salary.mapper.sischeme.InsuranceSchemeMapper; +import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.SIImportService; import com.engine.salary.service.SISchemeService; import com.engine.salary.service.TaxAgentService; @@ -86,6 +87,9 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { private InsuranceSchemeMapper getInsuranceSchemeMapper() { return MapperProxyFactory.getProxy(InsuranceSchemeMapper.class); } + private TaxAgentMapper getTaxAgentMapper() { + return MapperProxyFactory.getProxy(TaxAgentMapper.class); + } private ICategoryMapper getICategoryMapper() { return MapperProxyFactory.getProxy(ICategoryMapper.class); @@ -201,6 +205,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { @Override public List> buildTableData(List insuranceArchivesEmployeePOS) { List> records = new ArrayList<>(); + List taxAgentPOS = getTaxAgentMapper().listAll(); + Map longTaxAgentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId); List employeeIds = insuranceArchivesEmployeePOS.stream().map(InsuranceArchivesEmployeePO::getEmployeeId).collect(Collectors.toList()); if (CollectionUtils.isEmpty(employeeIds)) { return records; @@ -239,6 +245,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { map.put("departmentName", item.getDepartmentName()); map.put("departmentId", item.getDepartmentId()); map.put("jobNum", item.getJobNum()); + map.put("paymentOrganizationName", longTaxAgentPOMap.get(item.getPaymentOrganization()) != null ? longTaxAgentPOMap.get(item.getPaymentOrganization()).getName() : ""); map.put("mobile", item.getTelephone()); map.put("status", item.getUserStatus() == null ? "" : UserStatusEnum.getDefaultLabelByValue(item.getUserStatus())); if (socialItem != null) { @@ -246,7 +253,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { Map socialJson = JSON.parseObject(socialItem.getSocialPaymentBaseString(), new TypeReference>() { }); if (socialJson != null) { - SalaryEntityUtil.thousandthConvert(socialJson, map); + map.putAll(socialJson); + // SalaryEntityUtil.thousandthConvert(socialJson, map); } map.put("socialAccount", socialItem.getSocialAccount()); map.put("socialStartTime", socialItem.getSocialStartTime()); @@ -258,7 +266,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { Map fundJson = JSON.parseObject(fundItem.getFundPaymentBaseString(), new TypeReference>() { }); if (fundJson != null) { - SalaryEntityUtil.thousandthConvert(fundJson, map); + map.putAll(fundJson); + // SalaryEntityUtil.thousandthConvert(fundJson, map); } map.put("supplementFundAccount", fundItem.getSupplementFundAccount()); map.put("fundStartTime", fundItem.getFundStartTime()); @@ -270,7 +279,8 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { Map otherJson = JSON.parseObject(otherItem.getOtherPaymentBaseString(), new TypeReference>() { }); if (otherJson != null) { - SalaryEntityUtil.thousandthConvert(otherJson, map); + map.putAll(otherJson); + //SalaryEntityUtil.thousandthConvert(otherJson, map); } map.put("otherStartTime", otherItem.getOtherStartTime()); map.put("otherEndTime", otherItem.getOtherEndTime()); @@ -399,6 +409,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86185, "部门"), "departmentName")); list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86186, "手机号"), "mobile")); list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(86187, "员工状态"), "status")); + list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(93910, "个税扣缴义务人"), "paymentOrganizationName")); list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(91323, "社保方案名称"), "socialName")); titleMap.get(WelfareTypeEnum.SOCIAL_SECURITY.getValue()).forEach((k, v) -> list.add(new WeaTableColumn("150px", v, k))); list.add(new WeaTableColumn("150px", SalaryI18nUtil.getI18nLabel(91324, "社保账号"), "socialAccount")); diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index 987bfbabd..ee9d0a463 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -12,6 +12,7 @@ import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.SalarySobRangeService; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.db.MapperProxyFactory; +import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.math.NumberUtils; import weaver.hrm.User; @@ -98,7 +99,12 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee if(CollectionUtils.isEmpty(simpleEmployeeIds)){ return new ArrayList<>(); } - return getEmployMapper().getEmployeeByIds(simpleEmployeeIds); + List employeeList = new ArrayList<>(); + List> partition = Lists.partition(simpleEmployeeIds, 1000); + for (List longs : partition) { + employeeList.addAll(getEmployMapper().getEmployeeByIds(longs)); + } + return employeeList; } }