diff --git a/src/com/engine/salary/biz/EmployBiz.java b/src/com/engine/salary/biz/EmployBiz.java index 5b2e288ba..beb8c4741 100644 --- a/src/com/engine/salary/biz/EmployBiz.java +++ b/src/com/engine/salary/biz/EmployBiz.java @@ -17,6 +17,16 @@ import java.util.List; public class EmployBiz extends BaseBean { + public List listAll(){ + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + EmployMapper mapper = sqlSession.getMapper(EmployMapper.class); + return mapper.listAll(); + } finally { + sqlSession.close(); + } + } + /** * 查询人员列表 * @@ -158,4 +168,15 @@ public class EmployBiz extends BaseBean { sqlSession.close(); } } + + public List listAllForReport() { + SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); + try { + EmployMapper mapper = sqlSession.getMapper(EmployMapper.class); + return mapper.listAllForReport(); + } finally { + sqlSession.close(); + } + } + } diff --git a/src/com/engine/salary/biz/SIArchivesBiz.java b/src/com/engine/salary/biz/SIArchivesBiz.java index a41f1f72a..43c72f76b 100644 --- a/src/com/engine/salary/biz/SIArchivesBiz.java +++ b/src/com/engine/salary/biz/SIArchivesBiz.java @@ -40,6 +40,8 @@ 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.SalaryEmployeeService; +import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; import com.engine.salary.util.SalaryAssert; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryFormItemUtil; @@ -110,6 +112,10 @@ public class SIArchivesBiz { return ServiceUtil.getService(TaxAgentWrapper.class, user); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + /** * @param welfareType * @param employeeId @@ -120,8 +126,7 @@ public class SIArchivesBiz { public Map getBaseForm(WelfareTypeEnum welfareType, Long employeeId, Long operateId, User user, Long paymentOrganization) { Map data = new HashMap<>(16); SalaryAssert.notNull(employeeId, "员工id不可为空"); - EmployBiz employBiz = new EmployBiz(); - List employeeByIds = employBiz.getEmployeeByIdsAll(Collections.singletonList(employeeId)); + List employeeByIds = getSalaryEmployeeService(user).getEmployeeByIdsAll(Collections.singletonList(employeeId)); SalaryAssert.notEmpty(employeeByIds, "员工信息不存在"); DataCollectionEmployee item = employeeByIds.get(0); diff --git a/src/com/engine/salary/service/SalaryEmployeeService.java b/src/com/engine/salary/service/SalaryEmployeeService.java index a31b12692..eb7d56277 100644 --- a/src/com/engine/salary/service/SalaryEmployeeService.java +++ b/src/com/engine/salary/service/SalaryEmployeeService.java @@ -1,6 +1,10 @@ package com.engine.salary.service; import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.hrm.DeptInfo; +import com.engine.salary.entity.hrm.PositionInfo; +import com.engine.salary.entity.hrm.SubCompanyInfo; +import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import java.util.List; @@ -40,7 +44,7 @@ public interface SalaryEmployeeService { * @param ids * @return 全量 */ - List listByIds(List ids); + List getEmployeeByIdsAll(List ids); /** * 获取人员信息 @@ -73,4 +77,17 @@ public interface SalaryEmployeeService { * @param uid 人员id */ List matchImportEmployee(List employeeList, String userName, String deparmentName, String mobile, String workcode, Long uid); + + String empValidType(); + + List getDeptInfoList(List departmentIds); + + List getSubCompanyInfoList(List subDepartmentIds); + + List listPositionInfo(List positionIds); + + List listEmployee(); + + List listByParams(List includeQueryParams); + } diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index edeb2ed77..0927159f2 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -195,7 +195,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); Map apidatas = new HashMap(); - EmployBiz employBiz = new EmployBiz(); + AddUpDeductionBiz addUpDeductionBiz = new AddUpDeductionBiz(); //检验参数 @@ -211,7 +211,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction //个税扣缴义务人 String taxAgentId = Util.null2String(importParam.getTaxAgentId()); // 获取租户下所有的人员 - List employees = employBiz.listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); // 已经核算过的不可操作 // 获取已经核算的数据 List salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr); @@ -437,7 +437,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction public void createAddUpDeduction(AddUpDeductionRecordParam addUpDeductionRecordParam) { long currentEmployeeId = user.getUID(); Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); - EmployBiz employBiz = new EmployBiz(); AddUpDeductionBiz addUpDeductionBiz = new AddUpDeductionBiz(); //税款所属期 @@ -450,7 +449,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction //个税扣缴义务人 String taxAgentId = Util.null2String(addUpDeductionRecordParam.getTaxAgentId()); // 获取租户下所有的人员 - List employees = employBiz.listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); // 已经核算过的不可操作 // 获取已经核算的数据 List salaryAcctEmployees = getAccountedEmployeeData(declareMonthStr); @@ -729,7 +728,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction .forEach(l -> getAddUpDeductionMapper().updateDataAndDeclareMonth((List) l)); if (!errorMessages.isEmpty()) { String userNames = getSalaryEmployeeService(user) - .listByIds(errorMessages) + .getEmployeeByIdsAll(errorMessages) .stream() .map(DataCollectionEmployee::getUsername) .collect(Collectors.joining(",")); @@ -885,8 +884,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction @Override public XSSFWorkbook exportDetail(Long beLongEmployeeId, boolean isChief, AddUpDeductionQueryParam queryParam) { queryParam.setEmployeeId(beLongEmployeeId); - - EmployBiz employBiz = new EmployBiz(); AddUpDeductionBiz biz = new AddUpDeductionBiz(); Long id = queryParam.getAccumulatedSpecialAdditionalDeductionId(); @@ -899,7 +896,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction throw new SalaryRunTimeException(String.format("累计专项附加扣除不存在" + "[id:%s]", id)); } - List employeeList = employBiz.getEmployeeByIds(Collections.singletonList(po.getEmployeeId())); + List employeeList = getSalaryEmployeeService(user).getEmployeeByIds(Collections.singletonList(po.getEmployeeId())); if (CollectionUtils.isEmpty(employeeList)) { throw new SalaryRunTimeException("员工信息不存在"); } diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index f3b04ecf1..305cac028 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -395,7 +395,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation @Override public XSSFWorkbook exportDetail(AddUpSituationQueryParam queryParam) { AddUpSituationBiz biz = new AddUpSituationBiz(); - EmployBiz employBiz = new EmployBiz(); Long id = queryParam.getAccumulatedSituationId(); if (id == null) { @@ -407,7 +406,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation throw new SalaryRunTimeException(String.format("累计情况不存在" + "[id:%s]", id)); } - List employeeList = employBiz.getEmployeeByIds(Collections.singletonList(po.getEmployeeId())); + List employeeList = getSalaryEmployeeService(user).getEmployeeByIds(Collections.singletonList(po.getEmployeeId())); if (CollectionUtils.isEmpty(employeeList)) { throw new SalaryRunTimeException("员工信息不存在"); } @@ -583,7 +582,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); Map apidatas = new HashMap(); - EmployBiz employBiz = new EmployBiz(); AddUpSituationBiz biz = new AddUpSituationBiz(); //查询对于人员信息导入筛选的全局配置 @@ -603,7 +601,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); // 获取租户下所有的人员 - List employees = employBiz.listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); // 已经核算过的不可操作 // 获取已经核算的数据(获取税款所属期下一个月的数据) YearMonth nextTaxYearMonth = SalaryDateUtil.String2YearMonth(taxYearMonthStr); @@ -907,7 +905,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation @Override public void createAddUpSituation(AddUpSituationParam addUpSituationParam) { Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); - EmployBiz employBiz = new EmployBiz(); AddUpSituationBiz biz = new AddUpSituationBiz(); //查询对于人员信息导入筛选的全局配置 @@ -919,7 +916,7 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); // 获取租户下所有的人员 - List employees = employBiz.listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); // 已经核算过的不可操作 // 获取已经核算的数据 List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(taxYearMonthStr); diff --git a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java index fd91d82b6..a3e279fec 100644 --- a/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java +++ b/src/com/engine/salary/service/impl/AttendQuoteDataServiceImpl.java @@ -91,7 +91,6 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa private AttendQuoteDataBiz dataBiz = new AttendQuoteDataBiz(); private AttendQuoteDataValueBiz dataValueBiz = new AttendQuoteDataValueBiz(); private AttendQuoteFieldBiz fieldBiz = new AttendQuoteFieldBiz(); - private EmployBiz employeeBiz = new EmployBiz(); private AttendQuoteFieldSettingService getFieldSettingService(User user) { return ServiceUtil.getService(AttendQuoteFieldSettingServiceImpl.class, user); @@ -596,7 +595,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; // 获取租户下所有的人员 - List employees = employeeBiz.listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); // 获取已设置的可同步的考勤字段 List attendQuoteFields = getAttendQuoteSetFields(AttendQuoteSourceTypeEnum.IMPORT); // 生成获取考勤引用 diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index e080fb0c3..445c49c3f 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -177,7 +177,6 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction long currentEmployeeId = user.getUID(); Map apidatas = new HashMap(); - EmployBiz employBiz = new EmployBiz(); OtherDeductionBiz OtherDeductionBiz = new OtherDeductionBiz(); //查询对于人员信息导入筛选的全局配置 @@ -206,7 +205,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction int errorCount = 0; //人员信息 - List employees = employBiz.listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); //税款所属期 @@ -480,7 +479,6 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction public XSSFWorkbook exportDetail(OtherDeductionQueryParam param) { OtherDeductionBiz biz = new OtherDeductionBiz(); - EmployBiz employBiz = new EmployBiz(); Long id = param.getOtherTaxExemptDeductionId(); if (id == null) { @@ -492,7 +490,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction throw new SalaryRunTimeException(String.format("其他免税扣除不存在" + "[id:%s]", id)); } - List employeeList = employBiz.getEmployeeByIds(Collections.singletonList(po.getEmployeeId())); + List employeeList = getSalaryEmployeeService(user).getEmployeeByIds(Collections.singletonList(po.getEmployeeId())); if (CollectionUtils.isEmpty(employeeList)) { throw new SalaryRunTimeException("员工信息不存在"); } @@ -601,7 +599,6 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction long currentEmployeeId = user.getUID(); Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); OtherDeductionBiz OtherDeductionBiz = new OtherDeductionBiz(); - EmployBiz employBiz = new EmployBiz(); //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; @@ -609,7 +606,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction //税款所属期 String declareMonthStr = Util.null2String(otherDeductionParam.getDeclareMonth()); //人员信息 - List employees = employBiz.listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); //税款所属期 diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index e5e6f8672..3d33bbff1 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -171,8 +171,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { return MapperProxyFactory.getProxy(FundSchemeMapper.class); } - private EmployBiz employeeBiz = new EmployBiz(); - private TaxAgentBiz taxAgentBiz = new TaxAgentBiz(); private ICategoryMapper getICategoryMapper() { @@ -1242,7 +1240,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); Map apidatas = new HashMap(); - EmployBiz employBiz = new EmployBiz(); //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); @@ -1259,7 +1256,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getName, TaxAgentPO::getId); // 获取租户下所有的人员 - List salaryEmployees = employBiz.listEmployee(); + List salaryEmployees = getSalaryEmployeeService(user).listEmployee(); // 失败的数量 int failCount = 0; @@ -1535,7 +1532,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { for(InsuranceAccountDetailPO po : supplyDataList) { Map resultMap = new HashMap<>(); - employee = employeeBiz.getEmployeeById(po.getEmployeeId()); + employee = getSalaryEmployeeService(user).getEmployeeById(po.getEmployeeId()); resultMap.put("username", employee.getUsername()); resultMap.put("departmentName", employee.getDepartmentName()); resultMap.put("mobile", employee.getMobile()); @@ -1575,7 +1572,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { for(InsuranceAccountDetailPO po : normalDataList) { Map resultMap = new HashMap<>(); - employee = employeeBiz.getEmployeeById(po.getEmployeeId()); + employee = getSalaryEmployeeService(user).getEmployeeById(po.getEmployeeId()); resultMap.put("username", employee.getUsername()); resultMap.put("departmentName", employee.getDepartmentName()); resultMap.put("mobile", employee.getMobile()); @@ -1910,8 +1907,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { public Map importExcelInsuranceDetail(ExcelInsuranceImportParam importParam) { Map apidatas = new HashMap(); - EmployBiz employBiz = new EmployBiz(); - //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; @@ -1924,7 +1919,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { } // 获取租户下所有的人员 - List salaryEmployees = employBiz.listEmployee(); + List salaryEmployees = getSalaryEmployeeService(user).listEmployee(); // 失败的数量 int failCount = 0; @@ -2599,7 +2594,6 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); Map apidatas = new HashMap(); - EmployBiz employBiz = new EmployBiz(); //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); @@ -2616,7 +2610,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { // Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getName, TaxAgentPO::getId); // 获取租户下所有的人员 - List salaryEmployees = employBiz.listEmployee(); + List salaryEmployees = getSalaryEmployeeService(user).listEmployee(); List insuranceCategoryPOS = getICategoryMapper().listAll(); // 失败的数量 diff --git a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java index 0e91bce27..1a7908aaf 100644 --- a/src/com/engine/salary/service/impl/SISchemeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SISchemeServiceImpl.java @@ -124,8 +124,6 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { return ServiceUtil.getService(SIImportServiceImpl.class, user); } - private EmployBiz employeeBiz = new EmployBiz(); - private SIArchivesBiz siArchivesBiz = new SIArchivesBiz(); private SalaryEmployeeService getSalaryEmployeeService(User user) { @@ -635,7 +633,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { List taxAgentManageRangeEmployeeTree = getTaxAgentService().listTaxAgentAndEmployeeTree(); // 获取所有人员信息 - List employeeByIds = employeeBiz.listEmployee(); + List employeeByIds = getSalaryEmployeeService(user).listEmployee(); int total = 0; int index = 0; @@ -1402,7 +1400,7 @@ public class SISchemeServiceImpl extends Service implements SISchemeService { List taxAgentManageRangeEmployeeTree = getTaxAgentService().listTaxAgentAndEmployeeTree(); // 获取所有人员信息 - List employeeByIds = employeeBiz.listEmployee(); + List employeeByIds = getSalaryEmployeeService(user).listEmployee(); int total = 0; int index = 0; diff --git a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java index e2752a3d1..7ad03955c 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctCalculateServiceImpl.java @@ -110,7 +110,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc // 数据库字段加密用 // 1、查询人员信息 List employeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getEmployeeId, Collectors.toList()); - List simpleEmployees = getSalaryEmployeeService(user).listByIds(employeeIds); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); SalarySobCycleDTO salarySobCycleDTO = salaryAcctCalculateBO.getSalarySobCycleDTO(); Long taxAgentId = salaryAcctCalculateBO.getSalarySobPO().getTaxAgentId(); // 2、查询薪资档案的数据 diff --git a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java index 11bb3bd78..035f36a73 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctExcelServiceImpl.java @@ -242,7 +242,7 @@ public class SalaryAcctExcelServiceImpl extends Service implements SalaryAcctExc for (List tempList : partition) { // 人员 List employeeIds = tempList.stream().map(SalaryAcctEmployeePO::getEmployeeId).collect(Collectors.toList()); - List simpleEmployees = getSalaryEmployeeService(user).listByIds(employeeIds); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); // 个税扣缴义务人 List taxAgentIds = tempList.stream().map(SalaryAcctEmployeePO::getTaxAgentId).distinct().collect(Collectors.toList()); List taxAgents = getTaxAgentService(user).listByIds(taxAgentIds); diff --git a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java index 1f1bd0c68..7bf2a532d 100644 --- a/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryAcctResultServiceImpl.java @@ -361,7 +361,7 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe List salaryAcctResultPOS = listBySalaryAcctEmployeeIds(salaryAcctEmployeeIds); // 查询人员信息 List employeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getEmployeeId, Collectors.toList()); - List simpleEmployees = getSalaryEmployeeService(user).listByIds(employeeIds); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); // 查询个税扣缴义务人 Set taxAgentIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getTaxAgentId); List taxAgentPOS = getTaxAgentService(user).listByIds(taxAgentIds); diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index 421af7ebd..5c3b72f25 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -88,7 +88,6 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch } private SalaryArchiveBiz salaryArchiveMapper = new SalaryArchiveBiz(); - private EmployBiz employBiz = new EmployBiz(); private SalaryArchiveItemBiz salaryArchiveItemMapper = new SalaryArchiveItemBiz(); private SalaryArchiveTaxAgentBiz salaryArchiveTaxAgentMapper = new SalaryArchiveTaxAgentBiz(); private SalaryArchiveDimissionBiz salaryArchiveDimissionMapper = new SalaryArchiveDimissionBiz(); diff --git a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java index e10db85dc..4e93bfb3a 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveServiceImpl.java @@ -79,7 +79,6 @@ import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX; public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveService { private SalaryArchiveBiz salaryArchiveMapper = new SalaryArchiveBiz(); - private EmployBiz employBiz = new EmployBiz(); private SalaryArchiveItemBiz salaryArchiveItemMapper = new SalaryArchiveItemBiz(); private SalaryArchiveTaxAgentBiz salaryArchiveTaxAgentMapper = new SalaryArchiveTaxAgentBiz(); private SalaryArchiveDimissionBiz salaryArchiveDimissionMapper = new SalaryArchiveDimissionBiz(); diff --git a/src/com/engine/salary/service/impl/SalaryComparisonResultServiceImpl.java b/src/com/engine/salary/service/impl/SalaryComparisonResultServiceImpl.java index 8d99c24da..6b364347c 100644 --- a/src/com/engine/salary/service/impl/SalaryComparisonResultServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryComparisonResultServiceImpl.java @@ -195,7 +195,7 @@ public class SalaryComparisonResultServiceImpl extends Service implements Salary List taxAgentPOS = getTaxAgentService(user).listByIds(taxAgentIds); // 查询人员信息 List employeeIds = SalaryEntityUtil.properties(salaryAcctEmployeePOS, SalaryAcctEmployeePO::getEmployeeId, Collectors.toList()); - List simpleEmployees = getSalaryEmployeeService(user).listByIds(employeeIds); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); // 判断是否存在合并计税 Set salaryAcctEmployeeIds4ConsolidatedTax; if (StringUtils.isEmpty(queryParam.getConsolidatedTaxation())) { diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index ccc16521a..aa3db586b 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -5,6 +5,9 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.EmployBiz; import com.engine.salary.entity.datacollection.DataCollectionEmployee; +import com.engine.salary.entity.hrm.DeptInfo; +import com.engine.salary.entity.hrm.PositionInfo; +import com.engine.salary.entity.hrm.SubCompanyInfo; import com.engine.salary.entity.salarysob.bo.SalarySobRangeBO; import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.entity.salarysob.po.SalarySobRangePO; @@ -93,7 +96,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee } @Override - public List listByIds(List ids) { + public List getEmployeeByIdsAll(List ids) { return employBiz.getEmployeeByIdsAll(ids); } @@ -110,7 +113,7 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee List employeeList = new ArrayList<>(); List> partition = Lists.partition(simpleEmployeeIds, 1000); for (List longs : partition) { - employeeList.addAll(getEmployMapper().getEmployeeByIds(longs)); + employeeList.addAll(employBiz.getEmployeeByIds(longs)); } return employeeList; @@ -156,4 +159,44 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee return employees; } + + /** + * 人员定位方式 + * “0”代表姓名+部门+手机号的匹配原则,“1”代表工号为唯一匹配原则 + * + * @return + */ + @Override + public String empValidType() { + SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + return (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; + } + + @Override + public List getDeptInfoList(List departmentIds) { + return employBiz.getDeptInfoList(departmentIds); + } + + @Override + public List getSubCompanyInfoList(List subDepartmentIds) { + return employBiz.getSubCompanyInfoList(subDepartmentIds); + } + + @Override + public List listPositionInfo(List positionIds) { + return employBiz.listPositionInfo(positionIds); + } + + @Override + public List listEmployee() { + List result = employBiz.listEmployee(); + return result; + } + + @Override + public List listByParams(List includeQueryParams) { + List result = employBiz.listByParams(includeQueryParams); + return result; + } + } diff --git a/src/com/engine/salary/service/impl/SalarySendRangeServiceImpl.java b/src/com/engine/salary/service/impl/SalarySendRangeServiceImpl.java index bf15ff818..98e1b3e0f 100644 --- a/src/com/engine/salary/service/impl/SalarySendRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySendRangeServiceImpl.java @@ -45,7 +45,6 @@ public class SalarySendRangeServiceImpl extends Service implements SalarySendRan return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } - private EmployBiz employBiz = new EmployBiz(); private R applyMapper(Function mapper) { try (SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession()) { @@ -116,17 +115,17 @@ public class SalarySendRangeServiceImpl extends Service implements SalarySendRan .orElse(null); break; case DEPT: - targetName = employBiz.getDeptInfoList(Collections.singletonList(rangeObj.getTargetId())) + targetName = getSalaryEmployeeService().getDeptInfoList(Collections.singletonList(rangeObj.getTargetId())) .stream().findFirst() .map(DeptInfo::getName).orElse(null); break; case SUB_COMPANY: - targetName = employBiz.getSubCompanyInfoList(Collections.singletonList(rangeObj.getTargetId())) + targetName = getSalaryEmployeeService().getSubCompanyInfoList(Collections.singletonList(rangeObj.getTargetId())) .stream().findFirst() .map(SubCompanyInfo::getName).orElse(null); break; case POSITION: - targetName = employBiz.listPositionInfo(Collections.singletonList(rangeObj.getTargetId())) + targetName = getSalaryEmployeeService().listPositionInfo(Collections.singletonList(rangeObj.getTargetId())) .stream().findFirst() .map(PositionInfo::getName).orElse(null); break; diff --git a/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java index 9a6e12409..7a263ccff 100644 --- a/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobRangeServiceImpl.java @@ -66,7 +66,6 @@ import java.util.stream.Collectors; public class SalarySobRangeServiceImpl extends Service implements SalarySobRangeService { private SalarySobRangeBiz salarySobRangeBiz = new SalarySobRangeBiz(); - private EmployBiz employBiz = new EmployBiz(); private OrganizationShowSetBiz orgBiz = new OrganizationShowSetBiz(); @@ -116,7 +115,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange .filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.EMPLOYEE.getValue())) .map(SalarySobRangePO::getTargetId) .collect(Collectors.toList()); - List empInfos = employBiz.getEmployeeByIds(employeeIds); + List empInfos = getSalaryEmployeeService(user).getEmployeeByIds(employeeIds); // 查询部门信息 @@ -143,7 +142,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange .filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.POSITION.getValue())) .map(SalarySobRangePO::getTargetId) .collect(Collectors.toList()); - List positionInfos = employBiz.listPositionInfo(positionIds); + List positionInfos = getSalaryEmployeeService(user).listPositionInfo(positionIds); // 薪资账套的人员范围po转换成列表dto List salarySobRangeListDTOS = SalarySobRangeBO.convert2ListDTO(salarySobRangePOS, empInfos, deptInfos,subCompanyInfos, positionInfos); @@ -294,7 +293,7 @@ public class SalarySobRangeServiceImpl extends Service implements SalarySobRange int errorCount = 0; //人员信息 - List employees = employBiz.listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); // 错误excel内容 diff --git a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java index 18ea0cf0c..0921ab7ff 100644 --- a/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/SpecialAddDeductionServiceImpl.java @@ -175,7 +175,6 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd long currentEmployeeId = user.getUID(); Map apidatas = new HashMap(); - EmployBiz employBiz = new EmployBiz(); SpecialAddDeductionBiz SpecialAddDeductionBiz = new SpecialAddDeductionBiz(); //查询对于人员信息导入筛选的全局配置 @@ -202,7 +201,7 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd int errorCount = 0; //人员信息 - List employees = employBiz.listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); // 查询已有数据 @@ -402,7 +401,6 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd public XSSFWorkbook exportDetail(SpecialAddDeductionQueryParam param) { SpecialAddDeductionBiz biz = new SpecialAddDeductionBiz(); - EmployBiz employBiz = new EmployBiz(); Long id = param.getSpecialAddDeductionId(); if (id == null) { @@ -414,7 +412,7 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd throw new SalaryRunTimeException(String.format("专项附加扣除不存在" + "[id:%s]", id)); } - List employeeList = employBiz.getEmployeeByIds(Collections.singletonList(po.getEmployeeId())); + List employeeList = getSalaryEmployeeService(user).getEmployeeByIds(Collections.singletonList(po.getEmployeeId())); if (CollectionUtils.isEmpty(employeeList)) { throw new SalaryRunTimeException("员工信息不存在"); } @@ -519,13 +517,12 @@ public class SpecialAddDeductionServiceImpl extends Service implements SpecialAd long currentEmployeeId = user.getUID(); Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); SpecialAddDeductionBiz SpecialAddDeductionBiz = new SpecialAddDeductionBiz(); - EmployBiz employBiz = new EmployBiz(); //查询对于人员信息导入筛选的全局配置 SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; //人员信息 - List employees = employBiz.listEmployee(); + List employees = getSalaryEmployeeService(user).listEmployee(); // 获取所有个税扣缴义务人 Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); // 查询已有数据 diff --git a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java index b70fb2a91..680eb9337 100644 --- a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java @@ -98,8 +98,6 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM return ServiceUtil.getService(SIArchivesServiceImpl.class, user); } - private EmployBiz employBiz = new EmployBiz(); - private List listByTaxAgentIds(List taxAgentIds) { if (CollectionUtils.isEmpty(taxAgentIds)) { return Lists.newArrayList(); @@ -233,17 +231,17 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 查询人员信息 List employeeIds = taxAgentManageRanges.stream().filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.EMPLOYEE.getValue())).map(TaxAgentManageRangePO::getTargetId).collect(Collectors.toList()); // List employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, employeeIds); - List employeeComInfos = employBiz.getEmployeeByIdsAll(employeeIds); + List employeeComInfos = getSalaryEmployeeService().getEmployeeByIdsAll(employeeIds); // 查询部门信息 List departmentIds = taxAgentManageRanges.stream().filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.DEPT.getValue())).map(TaxAgentManageRangePO::getTargetId).collect(Collectors.toList()); - List departmentComInfos = employBiz.getDeptInfoList(departmentIds); + List departmentComInfos = getSalaryEmployeeService().getDeptInfoList(departmentIds); // 查询分部信息 List subDepartmentIds = taxAgentManageRanges.stream().filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.SUBCOMPANY.getValue())).map(TaxAgentManageRangePO::getTargetId).collect(Collectors.toList()); - List subDepartmentComInfos = employBiz.getSubCompanyInfoList(subDepartmentIds); + List subDepartmentComInfos = getSalaryEmployeeService().getSubCompanyInfoList(subDepartmentIds); // 查询岗位信息 List positionIds = taxAgentManageRanges.stream().filter(e -> Objects.equals(e.getTargetType(), TargetTypeEnum.POSITION.getValue())).map(TaxAgentManageRangePO::getTargetId).collect(Collectors.toList()); - List positionComInfos = employBiz.listPositionInfo(positionIds); + List positionComInfos = getSalaryEmployeeService().listPositionInfo(positionIds); // 分页参数 PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxAgentManageRangeListDTO.class); // 查询人员状态 @@ -589,7 +587,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM int errorCount = 0; //人员信息 - List employees = employBiz.listEmployee(); + List employees = getSalaryEmployeeService().listEmployee(); // 错误excel内容 List errorData = new ArrayList<>(); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java index 1bf1bc94c..a21906a39 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java @@ -110,7 +110,7 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla // 查询个税申报表明细 List taxDeclarationDetailPOS = listByTaxDeclarationIdAndEmployeeIds(queryParam.getTaxDeclarationId(), employeeIdPage); // 查询人员 - List simpleEmployees = getSalaryEmployeeService().listByIds(employeeIdPage); + List simpleEmployees = getSalaryEmployeeService().getEmployeeByIdsAll(employeeIdPage); // List simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(employeeIdPage.getRecords(), tenantKey); // 转换成列表dto TaxDeclarationBO.buildDetailListDTO(queryParam.getTaxDeclarationId(), dtoPage, taxDeclarationDetailPOS, simpleEmployees); @@ -181,7 +181,7 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla List employeeIds = taxDeclarationEmployees.stream().map(TaxDeclarationEmployeeDTO::getEmployeeId).collect(Collectors.toList()); List taxDeclarationDetailPOS = listByTaxDeclarationIdAndEmployeeIds(taxDeclarationId, employeeIds); // 查询人员信息 - List simpleEmployees = getSalaryEmployeeService().listByIds(employeeIds); + List simpleEmployees = getSalaryEmployeeService().getEmployeeByIdsAll(employeeIds); // 转换成列表dto return TaxDeclarationDetailBO.convert2ListDTO4Labor(taxDeclarationDetailPOS, taxDeclarationEmployees, simpleEmployees); } @@ -199,7 +199,7 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla List employeeIds = taxDeclarationEmployees.stream().map(TaxDeclarationEmployeeDTO::getEmployeeId).collect(Collectors.toList()); List taxDeclarationDetailPOS = listByTaxDeclarationIdAndEmployeeIds(taxDeclarationId, employeeIds); // 查询人员信息 - List simpleEmployees = getSalaryEmployeeService().listByIds(employeeIds); + List simpleEmployees = getSalaryEmployeeService().getEmployeeByIdsAll(employeeIds); // 转换成列表dto return TaxDeclarationDetailBO.convert2ListDTO4Annual(taxDeclarationDetailPOS, taxDeclarationEmployees, simpleEmployees); } diff --git a/src/com/engine/salary/wrapper/SalaryAcctEmployeeWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctEmployeeWrapper.java index 150ccfa06..526fbfcb5 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctEmployeeWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctEmployeeWrapper.java @@ -107,7 +107,7 @@ public class SalaryAcctEmployeeWrapper extends Service { } // 查询人员信息 List employeeIds = list.stream().map(SalaryAcctEmployeePO::getEmployeeId).collect(Collectors.toList()); - List simpleEmployees = getSalaryEmployeeService(user).listByIds(employeeIds); + List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); // 查询个税扣缴义务人 List taxAgentIds = list.stream().map(SalaryAcctEmployeePO::getTaxAgentId).collect(Collectors.toList()); List taxAgentPOS = getTaxAgentService(user).listByIds(taxAgentIds); diff --git a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java index 66f83facf..1d4e98899 100644 --- a/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryAcctRecordWrapper.java @@ -15,14 +15,8 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.service.SalaryAcctEmployeeService; -import com.engine.salary.service.SalaryAcctRecordService; -import com.engine.salary.service.SalarySendService; -import com.engine.salary.service.SalarySobService; -import com.engine.salary.service.impl.SalaryAcctEmployeeServiceImpl; -import com.engine.salary.service.impl.SalaryAcctRecordServiceImpl; -import com.engine.salary.service.impl.SalarySendServiceImpl; -import com.engine.salary.service.impl.SalarySobServiceImpl; +import com.engine.salary.service.*; +import com.engine.salary.service.impl.*; import com.engine.salary.util.SalaryDateUtil; import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; @@ -62,6 +56,10 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord return ServiceUtil.getService(SalarySendServiceImpl.class, user); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + // private ComInfoCache comInfoCache; public PageInfo listPage(SalaryAcctRecordQueryParam queryParam) { @@ -70,7 +68,6 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord SalarySobUtil.handleEmployeeStatusHistory(); // 处理工资单发放历史数据 getSalarySendService(user).handleHistory(); - EmployBiz employBiz = new EmployBiz(); // 查询薪资核算记录(分页) PageInfo page = getSalaryAcctRecordService(user).listPageByParam(queryParam); PageInfo dtoPage = new PageInfo(SalaryAcctRecordListDTO.class); @@ -84,7 +81,7 @@ public class SalaryAcctRecordWrapper extends Service implements SalaryAcctRecord List salarySobPOS = getSalarySobService(user).listByIds(salarySobIds); // 查询薪资核算记录的创建人员的人员信息 List employeeIds = SalaryEntityUtil.properties(list, SalaryAcctRecordPO::getCreator, Collectors.toList()); - List employeeComInfos = employBiz.getEmployeeByIdsAll(employeeIds); + List employeeComInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); // 查询薪资核算人数的数量 Set salaryAcctRecordIds = SalaryEntityUtil.properties(list, SalaryAcctRecordPO::getId); List salaryAcctEmployeeCountDTOS = getSalaryAcctEmployeeService(user).countBySalaryAcctRecordId(salaryAcctRecordIds); diff --git a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java index 300f0dda2..10c83de05 100644 --- a/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java +++ b/src/com/engine/salary/wrapper/SalaryArchiveWrapper.java @@ -53,7 +53,7 @@ public class SalaryArchiveWrapper extends Service { return ServiceUtil.getService(SalaryArchiveItemServiceImpl.class, user); } - private EmployBiz employeeService = new EmployBiz(); + private TaxAgentService getTaxAgentService(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); @@ -67,6 +67,10 @@ public class SalaryArchiveWrapper extends Service { return ServiceUtil.getService(SalaryArchiveExcelServiceImpl.class, user); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + /** * 薪资档案列表(分页) @@ -320,7 +324,7 @@ public class SalaryArchiveWrapper extends Service { throw new SalaryRunTimeException(String.format(SalaryI18nUtil.getI18nLabel(100463, "薪资档案不存在") + "[id:%s]", salaryArchiveId)); } - List employeeList = employeeService.getEmployeeByIdsAll(Collections.singletonList(po.getEmployeeId())); + List employeeList = getSalaryEmployeeService(user).getEmployeeByIdsAll(Collections.singletonList(po.getEmployeeId())); if (CollectionUtils.isEmpty(employeeList)) { throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100465, "薪资档案员工信息不存在")); } diff --git a/src/com/engine/salary/wrapper/TaxAgentSubAdminWrapper.java b/src/com/engine/salary/wrapper/TaxAgentSubAdminWrapper.java index b9025ead9..65341f888 100644 --- a/src/com/engine/salary/wrapper/TaxAgentSubAdminWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentSubAdminWrapper.java @@ -1,5 +1,6 @@ package com.engine.salary.wrapper; +import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.biz.EmployBiz; import com.engine.salary.entity.datacollection.DataCollectionEmployee; @@ -9,8 +10,10 @@ import com.engine.salary.entity.taxagent.param.*; import com.engine.salary.entity.taxagent.po.TaxAgentSubAdminPO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentManageRangeService; import com.engine.salary.service.TaxAgentSubAdminService; +import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; @@ -34,12 +37,14 @@ import java.util.stream.Collectors; **/ public class TaxAgentSubAdminWrapper extends Service { + private SalaryEmployeeService getSalaryEmployeeService() { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + private TaxAgentSubAdminService taxAgentSubAdminService; private TaxAgentManageRangeService taxAgentManageRangeService; // private HrmCommonEmployeeService hrmCommonEmployeeService; - private EmployBiz employBiz = new EmployBiz(); - /** * 获取分管理员列表 * @@ -51,7 +56,7 @@ public class TaxAgentSubAdminWrapper extends Service { List list = taxAgentSubAdminService.listByTaxAgentIds(Collections.singletonList(queryParam.getTaxAgentId())); String range = SalaryI18nUtil.getI18nLabel(106290, "详情"); - List subAdminList = employBiz.getEmployeeByIds(list.stream().map(TaxAgentSubAdminPO::getEmployeeId).distinct().collect(Collectors.toList())); + List subAdminList = getSalaryEmployeeService().getEmployeeByIds(list.stream().map(TaxAgentSubAdminPO::getEmployeeId).distinct().collect(Collectors.toList())); List records = TaxAgentBO.convertToSubAdminListDTO(list, range, subAdminList); PageInfo listPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxAgentSubAdminListDTO.class); @@ -95,7 +100,7 @@ public class TaxAgentSubAdminWrapper extends Service { taxAgentSubAdminBaseFormDTO.setDescription(taxAgentSubAdmin.getRemark()); TaxAgentEmployeeOptionDTO taxAgentEmployee = new TaxAgentEmployeeOptionDTO(); taxAgentEmployee.setId(taxAgentSubAdmin.getEmployeeId()); - DataCollectionEmployee employee = employBiz.getEmployeeById(taxAgentEmployee.getId()); + DataCollectionEmployee employee = getSalaryEmployeeService().getEmployeeById(taxAgentEmployee.getId()); taxAgentEmployee.setContent(employee == null ? "" : employee.getUsername()); taxAgentSubAdminBaseFormDTO.setSubAdminUser(Collections.singletonList(taxAgentEmployee)); diff --git a/src/com/engine/salary/wrapper/TaxAgentWrapper.java b/src/com/engine/salary/wrapper/TaxAgentWrapper.java index 9f9fa2f1f..86df32a70 100644 --- a/src/com/engine/salary/wrapper/TaxAgentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentWrapper.java @@ -146,7 +146,7 @@ public class TaxAgentWrapper extends Service { List list = page.getList(); List taxAgentIds = list.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); List taxAgentAdmins = getTaxAgentAdminService(user).listByTaxAgentIds(taxAgentIds); - List adminList = getSalaryEmployeeService(user).listByIds(taxAgentAdmins.stream().map(TaxAgentAdminPO::getEmployeeId).distinct().collect(Collectors.toList())); + List adminList = getSalaryEmployeeService(user).getEmployeeByIdsAll(taxAgentAdmins.stream().map(TaxAgentAdminPO::getEmployeeId).distinct().collect(Collectors.toList())); listPage.setList(TaxAgentBO.convertToTableListDTO(page.getList(), null, taxAgentAdmins, adminList, setLabel)); } else { listPage.setList(TaxAgentBO.convertToTableListDTO(page.getList(), null, setLabel)); diff --git a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java index b3f4a23c5..c29ee4f46 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationWrapper.java @@ -2,7 +2,6 @@ package com.engine.salary.wrapper; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; -import com.engine.salary.biz.EmployBiz; import com.engine.salary.component.WeaFormOption; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.taxagent.po.TaxAgentPO; @@ -14,8 +13,10 @@ import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryPara import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam; import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO; import com.engine.salary.exception.SalaryRunTimeException; +import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; import com.engine.salary.service.TaxDeclarationService; +import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; import com.engine.salary.service.impl.TaxAgentServiceImpl; import com.engine.salary.service.impl.TaxDeclarationServiceImpl; import com.engine.salary.util.SalaryDateUtil; @@ -48,6 +49,10 @@ public class TaxDeclarationWrapper extends Service { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } + private SalaryEmployeeService getSalaryEmployeeService(User user) { + return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user); + } + /** * 个税申报表列表 * @@ -56,7 +61,6 @@ public class TaxDeclarationWrapper extends Service { * @return */ public PageInfo listPage(TaxDeclarationListQueryParam queryParam) { - EmployBiz employBiz = new EmployBiz(); // 询个税申报表(分页) PageInfo page = getTaxDeclarationService(user).listPageByParam(queryParam); PageInfo dtoPage = new PageInfo(TaxDeclarationListDTO.class); @@ -67,7 +71,7 @@ public class TaxDeclarationWrapper extends Service { if (CollectionUtils.isNotEmpty(list)) { // 查询人员 List employeeIds = SalaryEntityUtil.properties(list, TaxDeclarationPO::getCreator, Collectors.toList()); - List employeeComInfos = employBiz.getEmployeeByIdsAll(employeeIds); + List employeeComInfos = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds); // 查询个税扣缴义务人 Set taxAgentIds = SalaryEntityUtil.properties(list, TaxDeclarationPO::getTaxAgentId); List taxAgentPOS = getTaxDeclarationService(user).countByTaxDeclarationId(taxAgentIds);