diff --git a/src/com/engine/salary/biz/EmployBiz.java b/src/com/engine/salary/biz/EmployBiz.java index beb8c4741..cc412c210 100644 --- a/src/com/engine/salary/biz/EmployBiz.java +++ b/src/com/engine/salary/biz/EmployBiz.java @@ -80,24 +80,6 @@ public class EmployBiz extends BaseBean { } } - public List getAdminEmployeeByIds(List list) { - if (CollectionUtils.isEmpty(list)) { - return new ArrayList<>(); - } - SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession(); - try { - EmployMapper mapper = sqlSession.getMapper(EmployMapper.class); - 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/biz/SIAccountBiz.java b/src/com/engine/salary/biz/SIAccountBiz.java index e70a1d972..9b15eff0f 100644 --- a/src/com/engine/salary/biz/SIAccountBiz.java +++ b/src/com/engine/salary/biz/SIAccountBiz.java @@ -9,9 +9,7 @@ import com.engine.salary.cache.SalaryCacheKey; import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.AESEncryptUtil; import com.engine.salary.encrypt.EncryptUtil; -import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.progress.ProgressDTO; -import com.engine.salary.entity.salaryacct.dto.SalaryAcctProgressDTO; import com.engine.salary.entity.siaccount.dto.InsuranceAccountViewListDTO; import com.engine.salary.entity.siaccount.dto.SIAccountUtilDTO; import com.engine.salary.entity.siaccount.param.*; diff --git a/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java b/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java index 926faa3cb..c8ae9e9c5 100644 --- a/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java +++ b/src/com/engine/salary/report/service/impl/SalaryStatisticsEmployeeServiceImpl.java @@ -10,6 +10,7 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; import com.engine.salary.mapper.salaryacct.SalaryAcctEmployeeMapper; import com.engine.salary.report.common.constant.SalaryConstant; import com.engine.salary.report.entity.bo.SalaryStatisticsEmployeeBO; @@ -138,7 +139,7 @@ public class SalaryStatisticsEmployeeServiceImpl extends Service implements Sala // .collect(Collectors.toSet()); // } if (CollectionUtils.isNotEmpty(innerEmployeeIds)) { - List salaryEmployees = getSalaryEmployeeService(user).listAll(); + List salaryEmployees = getSalaryEmployeeService(user).listAll(UseEmployeeTypeEnum.ALL); Set finalInnerEmployeeIds = innerEmployeeIds; innerEmployeeIds = salaryEmployees.stream() .filter(e -> finalInnerEmployeeIds.contains(e.getEmployeeId()) && (e.getUsername().contains(queryParam.getKeyword()) || (StringUtils.isNotEmpty(e.getWorkcode()) && e.getWorkcode().contains(queryParam.getKeyword())))) diff --git a/src/com/engine/salary/service/TaxAgentService.java b/src/com/engine/salary/service/TaxAgentService.java index 3794d51c8..2890f94b8 100644 --- a/src/com/engine/salary/service/TaxAgentService.java +++ b/src/com/engine/salary/service/TaxAgentService.java @@ -243,5 +243,11 @@ public interface TaxAgentService { Boolean adminChangeCheck(TaxAgentAdminChangeCheckParam checkParam); - + /** + * 获取个税扣缴义务人下的人员范围 + * + * @param taxAgentId + * @return + */ + Collection listEmployeeIdsInTaxAgent(Long taxAgentId); } diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index b77e25aaa..bb0242cf4 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -670,8 +670,6 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction List accountedEmployeeData = getAccountedEmployeeData(DateUtil.format(yearMonth, "yyyy-MM")); for (TaxAgentPO taxAgent : taxAgents) { - Collection employeeIds = getTaxAgentService(user) - .listEmployeeIdsInTaxAgent(taxAgent.getId()); List employeePOs = getSpecialAddDeductionService(user) .getSpecialAddDeductionPOByEmployee(null, taxAgent.getId()); diff --git a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java index 3c9c0b931..978563ab8 100644 --- a/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryArchiveExcelServiceImpl.java @@ -14,6 +14,7 @@ import com.engine.salary.entity.salaryarchive.param.SalaryArchiveQueryParam; import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO; import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; +import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentRangeSaveParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; @@ -23,6 +24,7 @@ import com.engine.salary.enums.salaryarchive.SalaryArchiveListTypeEnum; import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum; import com.engine.salary.mapper.archive.SalaryArchiveMapper; import com.engine.salary.service.*; +import com.engine.salary.sys.entity.po.SalarySysConfPO; import com.engine.salary.sys.service.SalarySysConfService; import com.engine.salary.sys.service.impl.SalarySysConfServiceImpl; import com.engine.salary.util.SalaryEntityUtil; @@ -620,7 +622,7 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch map = data.get(i); map.put("index", i + 2); // 3.校验行内容 - boolean isError = SalaryArchiveExcelBO.singleRowCheck(allTodoSalaryArchives, map, headers, effectiveTimeIndex, excelComments, errorCount, importHandleParam, confValue); + boolean isError = SalaryArchiveExcelBO.singleRowCheck(allTodoSalaryArchives, map, headers, effectiveTimeIndex, excelComments, errorCount, importHandleParam); if (isError) { errorCount += 1; // 添加错误数据 diff --git a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java index f93b44837..35ab6fb5b 100644 --- a/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryEmployeeServiceImpl.java @@ -14,6 +14,7 @@ import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam; import com.engine.salary.entity.salarysob.po.SalarySobRangePO; import com.engine.salary.enums.UserStatusEnum; import com.engine.salary.enums.datacollection.UseEmployeeTypeEnum; +import com.engine.salary.mapper.datacollection.EmployMapper; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.ExtEmpService; import com.engine.salary.service.SalaryEmployeeService; @@ -21,6 +22,7 @@ import com.engine.salary.service.SalarySobExtRangeService; import com.engine.salary.service.SalarySobRangeService; import com.engine.salary.sys.entity.po.SalarySysConfPO; 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.StringUtils; @@ -59,6 +61,11 @@ public class SalaryEmployeeServiceImpl extends Service implements SalaryEmployee return ServiceUtil.getService(ExtEmpServiceImpl.class, user); } + + private SalarySobExtRangeService getSalarySobExtRangeService(User user) { + return ServiceUtil.getService(SalarySobExtRangeServiceImpl.class, user); + } + boolean openExtEmp = true; @Override diff --git a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java index b3e7785e8..06cdeb04f 100644 --- a/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentManageRangeServiceImpl.java @@ -4,6 +4,7 @@ import com.api.formmode.mybatis.util.SqlProxyHandle; import com.cloudstore.dev.api.util.Util_DataCache; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.entity.datacollection.DataCollectionEmployee; import com.engine.salary.entity.hrm.DeptInfo; import com.engine.salary.entity.hrm.HrmStatus; @@ -325,7 +326,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 去重 allRanges = allRanges.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTaxAgentId() + "." + f.getRangeType() + "." + f.getTargetType() + "." + f.getTargetId() + "." + f.getEmployeeStatus() + "." + f.getIncludeType()))), ArrayList::new)); - List salaryEmployees = getEmployMapper().listAll(); + List salaryEmployees = getSalaryEmployeeService().listAll(UseEmployeeTypeEnum.ALL); List allSalaryEmployees = this.getManageRangeSalaryEmployees(saveParam.getTaxAgentId(), allRanges, salaryEmployees); /* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */ @@ -859,7 +860,7 @@ public class TaxAgentManageRangeServiceImpl extends Service implements TaxAgentM // 去重 allRanges = allRanges.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(f -> f.getTaxAgentId() + "." + f.getRangeType() + "." + f.getTargetType() + "." + f.getTargetId() + "." + f.getEmployeeStatus() + "." + f.getIncludeType()))), ArrayList::new)); - List salaryEmployees = getEmployMapper().listAll(); + List salaryEmployees = getSalaryEmployeeService().listAll(UseEmployeeTypeEnum.ALL); List allSalaryEmployees = this.getManageRangeSalaryEmployees(taxAgentId, allRanges, salaryEmployees); /* 检查当前个税扣缴义务人的所有人员范围与所有分管理员的管理范围===========================end */ diff --git a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java index b0019fb39..cf118a036 100644 --- a/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxAgentServiceImpl.java @@ -33,6 +33,7 @@ import com.engine.salary.mapper.datacollection.OtherDeductionMapper; import com.engine.salary.mapper.salarysob.SalarySobMapper; import com.engine.salary.mapper.taxagent.TaxAgentMapper; import com.engine.salary.service.*; +import com.engine.salary.util.SalaryEntityUtil; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.db.MapperProxyFactory; import com.engine.salary.util.page.PageInfo; @@ -765,4 +766,12 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService { return taxAgentEmployeeList; } + @Override + public Collection listEmployeeIdsInTaxAgent(Long taxAgentId) { + List taxAgentEmpPOS = getTaxAgentEmpService(user).listByTaxAgentIds(Collections.singletonList(taxAgentId),UseEmployeeTypeEnum.ALL); + + return SalaryEntityUtil.properties(taxAgentEmpPOS, TaxAgentEmpPO::getEmployeeId); + } + + } diff --git a/src/com/engine/salary/web/SalarySobController.java b/src/com/engine/salary/web/SalarySobController.java index 708886864..840e1bc33 100644 --- a/src/com/engine/salary/web/SalarySobController.java +++ b/src/com/engine/salary/web/SalarySobController.java @@ -2,7 +2,6 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; import com.engine.salary.entity.SalarySobExtRangePO; -import com.engine.salary.entity.salaryitem.dto.SalaryItemListDTO; import com.engine.salary.entity.salaryitem.dto.SalaryItemSobListDTO; import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam; import com.engine.salary.entity.salarysob.dto.*; @@ -184,6 +183,33 @@ public class SalarySobController { // return WeaResult.success(weaForm); // } + @POST + @Path("/ext/save") + @Produces(MediaType.APPLICATION_JSON) + public String saveSalarySobExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeExtSaveParam saveParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getSalarySobRangeWrapper(user)::saveExtRange, saveParam); + } + + @POST + @Path("/range/ext/list") + @Produces(MediaType.APPLICATION_JSON) + public String listPage4Ext(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalarySobRangeQueryParam queryParam) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getSalarySobRangeWrapper(user)::listPage4Ext, queryParam); + } + + /** + * 删除薪资账套人员范围 + */ + @POST + @Path("/range/ext/delete") + @Produces(MediaType.APPLICATION_JSON) + public String deleteSalarySobExtRange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection ids) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult, String>(user).run(getSalarySobRangeWrapper(user)::deleteSalarySobExtRange, ids); + } + /** * 保存薪资账套人员范围 */