diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRecordDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRecordDTO.java index 4de554f12..2c34eaef4 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRecordDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpDeductionRecordDTO.java @@ -10,6 +10,7 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.util.Date; +import java.util.Set; @Data @@ -18,6 +19,7 @@ import java.util.Date; @AllArgsConstructor //数据采集-累计专项附加扣除记录 @SalaryTable(pageId = "a4f85287-3354-4275-adn9-7d06e54y6rj8", tableType = WeaTableType.CHECKBOX) +@Auth(page = "addUpDeduction") public class AddUpDeductionRecordDTO { //主键id @@ -124,4 +126,6 @@ public class AddUpDeductionRecordDTO { @Encrypt private String addUpInfantCare; + private Set opts; + } diff --git a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java index e8c2fd0aa..5a9686b89 100644 --- a/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/AddUpSituationRecordDTO.java @@ -1,10 +1,7 @@ package com.engine.salary.entity.datacollection.dto; import com.cloudstore.eccom.pc.table.WeaTableType; -import com.engine.salary.annotation.Encrypt; -import com.engine.salary.annotation.SalaryTable; -import com.engine.salary.annotation.SalaryTableColumn; -import com.engine.salary.annotation.TableTitle; +import com.engine.salary.annotation.*; import com.engine.salary.util.excel.ExcelProperty; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; @@ -28,6 +25,7 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor @SalaryTable(pageId = "a5f85287-3354-4275-adn9-7d06e54y6rj8",tableType = WeaTableType.CHECKBOX) +@Auth(page = "addUpSituation") public class AddUpSituationRecordDTO { @SalaryTableColumn(column = "id", display = false) diff --git a/src/com/engine/salary/service/AddUpDeductionService.java b/src/com/engine/salary/service/AddUpDeductionService.java index 244658450..514564b4b 100644 --- a/src/com/engine/salary/service/AddUpDeductionService.java +++ b/src/com/engine/salary/service/AddUpDeductionService.java @@ -44,11 +44,10 @@ public interface AddUpDeductionService { /** * 下载模板 - * @param isChief * @param queryParam * @return */ - XSSFWorkbook downloadTemplate(boolean isChief,AddUpDeductionQueryParam queryParam); + XSSFWorkbook downloadTemplate(AddUpDeductionQueryParam queryParam); /** diff --git a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java index 969c1064b..2f79bb800 100644 --- a/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpDeductionServiceImpl.java @@ -26,8 +26,6 @@ import com.engine.salary.entity.datacollection.po.SpecialAddDeductionPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; -import com.engine.salary.entity.taxagent.bo.TaxAgentBO; -import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; @@ -947,18 +945,8 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction @Override public PageInfo recordListPage(AddUpDeductionQueryParam queryParam) { - long employeeId = (long) user.getUID(); - - Boolean needAuth = getTaxAgentService(user).isNeedAuth(employeeId); - if (needAuth) { - List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - if (CollectionUtils.isEmpty(taxAgentIdsAsAdmin)) { - return new PageInfo<>(AddUpDeductionRecordDTO.class); - } - queryParam.setTaxAgentIds(taxAgentIdsAsAdmin); - } - List list = getAddUpDeductionMapper().recordList(queryParam); + list = getAuthService(user).auth(list, AuthFilterTypeEnum.DATA_OPT, AddUpDeductionRecordDTO.class); PageInfo page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), list, AddUpDeductionRecordDTO.class); encryptUtil.decryptList(page.getList(), AddUpDeductionRecordDTO.class); return page; @@ -1060,7 +1048,7 @@ public class AddUpDeductionServiceImpl extends Service implements AddUpDeduction } @Override - public XSSFWorkbook downloadTemplate(boolean isChief, AddUpDeductionQueryParam queryParam) { + public XSSFWorkbook downloadTemplate(AddUpDeductionQueryParam queryParam) { String sheetName = SalaryI18nUtil.getI18nLabel(101603, "累计专项附加扣除导入模板"); String[] header = {SalaryI18nUtil.getI18nLabel(85429, "姓名"), SalaryI18nUtil.getI18nLabel(86184, "个税扣缴义务人"), SalaryI18nUtil.getI18nLabel(86185, "部门"), SalaryI18nUtil.getI18nLabel(86186, "手机号"), SalaryI18nUtil.getI18nLabel(86317, "工号"), SalaryI18nUtil.getI18nLabel(86318, "证件号码"), SalaryI18nUtil.getI18nLabel(86319, "入职日期"), SalaryI18nUtil.getI18nLabel(86321, "累计子女教育"), SalaryI18nUtil.getI18nLabel(86323, "累计继续教育"), SalaryI18nUtil.getI18nLabel(86324, "累计住房贷款利息"), SalaryI18nUtil.getI18nLabel(86325, "累计住房租金"), SalaryI18nUtil.getI18nLabel(86326, "累计赡养老人"), SalaryI18nUtil.getI18nLabel(105142, "累计大病医疗"), SalaryI18nUtil.getI18nLabel(105142, "累计婴幼儿照护")}; diff --git a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java index ebc4a01ab..04caffe35 100644 --- a/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java +++ b/src/com/engine/salary/service/impl/AddUpSituationServiceImpl.java @@ -349,7 +349,6 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation * @return */ private List> getExcelRowDetailList(AddUpSituationQueryParam param) { - long employeeId = user.getUID(); //excel标题 List title = Arrays.asList("姓名", "税款所属期", "个税扣缴义务人", "部门", "手机号", "工号", "累计收入额", "累计减除费用", "累计社保个人合计", "累计公积金个人合计", "累计子女教育", "累计继续教育", "累计住房贷款利息", "累计住房租金", "累计赡养老人", "累计大病医疗", "累计企业(职业)年金及其他福利", @@ -358,15 +357,8 @@ public class AddUpSituationServiceImpl extends Service implements AddUpSituation SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); //查询详细信息 List list = biz.recordList(param); + list = getAuthService(user).auth(list, AuthFilterTypeEnum.QUERY_DATA, AddUpSituationRecordDTO.class); - // 开启了分权 - if (getTaxAgentService(user).isOpenDevolution() || !getTaxAgentService(user).isChief(employeeId)) { - List taxAgentIdsAsAdmin = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId).stream().map(TaxAgentPO::getId).collect(Collectors.toList()); - list = list.stream().filter(f -> - // 作为管理员 - taxAgentIdsAsAdmin.contains(f.getTaxAgentId()) - ).collect(Collectors.toList()); - } final List> dataRowList = Optional.ofNullable(list) .map(List::stream) .map(operatorStream -> operatorStream.map(dto -> { diff --git a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java index 298bb2ebe..bbcbb459e 100644 --- a/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalaryItemServiceImpl.java @@ -1,6 +1,5 @@ package com.engine.salary.service.impl; -import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.StrUtil; import com.api.formmode.mybatis.util.SqlProxyHandle; @@ -20,6 +19,7 @@ import com.engine.salary.entity.salaryitem.config.SalaryItemExcelConfig; import com.engine.salary.entity.salaryitem.param.*; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salaryitem.po.SysSalaryItemPO; +import com.engine.salary.entity.salarysob.param.SalarySobQueryParam; import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO; import com.engine.salary.entity.salarysob.po.SalarySobItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; @@ -34,6 +34,8 @@ import com.engine.salary.enums.sicategory.SharedTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salaryitem.SalaryItemMapper; import com.engine.salary.service.*; +import com.engine.salary.service.auth.AuthService; +import com.engine.salary.service.auth.AuthServiceImpl; import com.engine.salary.sys.entity.vo.UploadConfigResponse; import com.engine.salary.util.JsonUtil; import com.engine.salary.util.SalaryEntityUtil; @@ -112,6 +114,10 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService return SqlProxyHandle.getProxy(SalaryItemMapper.class); } + public AuthService getAuthService(User user) { + return ServiceUtil.getService(AuthServiceImpl.class, user); + } + @Override public SalaryItemPO getById(Long id) { return salaryItemBiz.getById(id); @@ -448,16 +454,10 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService @Override public List> getSalarySobBySalaryItem(Long salaryItemId) { - // 查询所有启用的薪资账套 - List salarySobItemList = getSalarySobItemService(user).listBySalaryItemIds(Collections.singleton(salaryItemId)); - Set salarySobIds = SalaryEntityUtil.properties(salarySobItemList, SalarySobItemPO::getSalarySobId); - List salarySobs = getSalarySobService(user).listByIds(salarySobIds); - // 获取能够管理的义务人 - Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); - if (!isChief) { - Set taxAgentIds = SalaryEntityUtil.properties(getTaxAgentService(user).listAllTaxAgentsAsAdmin((long) user.getUID()), TaxAgentPO::getId); - salarySobs = salarySobs.stream().filter(sob -> CollectionUtil.intersection(taxAgentIds, sob.getTaxAgentIds()).size() > 0).collect(Collectors.toList()); - } + // 查询所有管理的薪资账套 + SalarySobQueryParam salarySobQueryParam = new SalarySobQueryParam(); + salarySobQueryParam.setFilterType(AuthFilterTypeEnum.ADMIN_DATA); + List salarySobs = getSalarySobService(user).listAuth(salarySobQueryParam); return salarySobs.stream().map(m -> { Map map = new HashMap<>(); map.put("id", String.valueOf(m.getId())); diff --git a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java index 99177af16..ee8d70180 100644 --- a/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java +++ b/src/com/engine/salary/service/impl/SalarySobItemServiceImpl.java @@ -2,30 +2,29 @@ package com.engine.salary.service.impl; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.biz.SalarySobBiz; import com.engine.salary.biz.SalarySobItemBiz; import com.engine.salary.biz.SalarySobItemGroupBiz; import com.engine.salary.biz.SalarySobItemHideBiz; import com.engine.salary.config.SalaryElogConfig; import com.engine.salary.constant.SalaryDefaultTenantConstant; -import com.engine.hrmelog.entity.dto.LoggerContext; import com.engine.salary.entity.salaryacct.bo.SalaryAcctConfig; -import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig; import com.engine.salary.entity.salaryformula.ExpressFormula; import com.engine.salary.entity.salaryformula.config.FormluaConfig; import com.engine.salary.entity.salaryformula.po.FormulaPO; import com.engine.salary.entity.salaryformula.po.FormulaVar; -import com.engine.salary.entity.salaryitem.config.SalaryItemAllConfig; -import com.engine.salary.entity.salaryitem.param.SalaryItemSearchParam; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.bo.SalarySobItemAggregateBO; import com.engine.salary.entity.salarysob.dto.SalarySobItemAggregateDTO; import com.engine.salary.entity.salarysob.dto.SalarySobItemFormDTO; import com.engine.salary.entity.salarysob.param.SalarySobItemSaveParam; import com.engine.salary.entity.salarysob.po.*; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.SalaryValueTypeEnum; +import com.engine.salary.enums.auth.AuthFilterTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.mapper.salarysob.SalarySobDefaultItemMapper; import com.engine.salary.mapper.salarysob.SalarySobEmpFieldMapper; @@ -234,13 +233,10 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe Set backCalcItemIds = SalaryEntityUtil.properties(salarySobBackItems, SalarySobBackItemPO::getSalaryItemId); salaryItemIds.addAll(backCalcItemIds); - Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); - final Set ids = new HashSet(); - if (needAuth) { - Set collect = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()).stream().map(TaxAgentPO::getId).collect(Collectors.toSet()); - ids.addAll(collect); - } - List salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds).stream().filter(po -> Boolean.FALSE.equals(needAuth) || getSalaryItemService(user).filterInRange(ids, po)).collect(Collectors.toList()); + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.QUERY_DATA); + Set ids = getTaxAgentService(user).listAuth(param).stream().map(TaxAgentPO::getId).collect(Collectors.toSet()); + List salaryItemPOS = getSalaryItemService(user).listByIds(salaryItemIds).stream().filter(po -> getSalaryItemService(user).filterInRange(ids, po)).collect(Collectors.toList()); //获取系统值 List salarySobDefaultItemPOS = getSalarySobDefaultItemMapper().listAll(); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java index a21906a39..d0937e392 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationDetailServiceImpl.java @@ -4,7 +4,6 @@ import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.DataCollectionEmployee; -import com.engine.salary.entity.taxagent.dto.TaxAgentEmployeeDTO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationDetailBO; import com.engine.salary.entity.taxdeclaration.dto.*; @@ -27,7 +26,6 @@ import com.engine.salary.util.page.PageInfo; import com.engine.salary.util.page.SalaryPageUtil; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.BooleanUtils; import weaver.hrm.User; import java.util.*; @@ -204,66 +202,13 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla return TaxDeclarationDetailBO.convert2ListDTO4Annual(taxDeclarationDetailPOS, taxDeclarationEmployees, simpleEmployees); } - /** - * 根据权限范围过滤 - * - * @param taxDeclarationPO - * @param taxDeclarationEmployeeDTOS - * @return - */ - private List filterByAuthority(TaxDeclarationPO taxDeclarationPO, List taxDeclarationEmployeeDTOS) { - long employeeId = user.getUID(); - if (CollectionUtils.isEmpty(taxDeclarationEmployeeDTOS)) { - return Collections.emptyList(); - } - // 判断是否开启了分权 - Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); - // 是否是总管理员 - Boolean isChief = getTaxAgentService(user).isChief(employeeId); - if (BooleanUtils.isFalse(openDevolution) || isChief) { - return taxDeclarationEmployeeDTOS; - } - // 查询权限范围内的人员 - List taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployee(employeeId); - Set simpleEmployeeKeySet = SalaryEntityUtil.properties(taxAgentEmployeeDTOS, taxAgentEmployeeDTO -> taxAgentEmployeeDTO.getEmployeeId() + "-" + taxAgentEmployeeDTO.getTaxAgentId()); - // 查询权限范围内的外部人员 -// List extEmployeePOS = extEmployeeService.listCanUseByEmployeeId(employeeId, tenantKey); -// Set extEmployeeKeySet = SalaryEntityUtil.properties(extEmployeePOS, extEmployeePO -> extEmployeePO.getId() + "-" + extEmployeePO.getTaxAgentId()); - // 根据权限范围过滤 - return taxDeclarationEmployeeDTOS.stream().filter(taxDeclarationEmployeeDTO -> { - if (taxDeclarationEmployeeDTO.getEmployeeType() == null || Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue()) - && simpleEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) { - return true; - } -// if (Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue()) -// && extEmployeeKeySet.contains(taxDeclarationEmployeeDTO.getEmployeeId() + "-" + taxDeclarationPO.getTaxAgentId())) { -// return true; -// } - return false; - }).collect(Collectors.toList()); - } - @Override public PageInfo listDtoPageByParam4Wage(TaxDeclarationDetailListQueryParam queryParam) { - // 查询个税申报主表 - TaxDeclarationPO taxDeclarationPO = getTaxDeclarationService(user).getById(queryParam.getTaxDeclarationId()); // 查询个税申报表明细的人员 - PageInfo employeeIdPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize()); - // 判断是否开启了分权 - Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); - // 是否是总管理员 - Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); -// if (BooleanUtils.isTrue(openDevolution) && !isChief) { -// List taxDeclarationEmployeeDTOS = getTaxDeclarationDetailMapper().list4EmployeeId(queryParam.getTaxDeclarationId()); -// // 根据权限过滤 -// taxDeclarationEmployeeDTOS = filterByAuthority(taxDeclarationPO, taxDeclarationEmployeeDTOS); -// employeeIdPage.setTotal(taxDeclarationEmployeeDTOS.size()); -// employeeIdPage.setList(SalaryPageUtil.subList((int) employeeIdPage.getPageNum(), (int) employeeIdPage.getPageSize(), taxDeclarationEmployeeDTOS)); -// } else { - employeeIdPage = listPage4EmployeeIdByParam(queryParam); -// } + PageInfo employeeIdPage = listPage4EmployeeIdByParam(queryParam); + PageInfo dtoPage = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize(), TaxDeclarationWageListDTO.class); dtoPage.setTotal(employeeIdPage.getTotal()); if (CollectionUtils.isNotEmpty(employeeIdPage.getList())) { @@ -279,15 +224,6 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla .map(TaxDeclarationEmployeeDTO::getEmployeeId) .collect(Collectors.toList()); List simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds); - // 查询人员薪资(身份证号码等) -// List simpleUserInfos = salaryEmployeeService.listByEmployeeIds(simpleEmployeeIds, tenantKey); - // 查询外部人员 -// Set extEmployeeIds = employeeIdPage.getRecords().stream() -// .filter(taxDeclarationEmployeeDTO -> Objects.equals(taxDeclarationEmployeeDTO.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) -// .map(TaxDeclarationEmployeeDTO::getEmployeeId) -// .collect(Collectors.toSet()); -// List extEmployees = extEmployeeService.listByIds(extEmployeeIds, tenantKey); - // 转换成列表dto List taxDeclarationWageListDTOS = TaxDeclarationDetailBO.convert2ListDTO4Wage(taxDeclarationDetailPOS, employeeIdPage.getList(), simpleEmployees); dtoPage.setList(taxDeclarationWageListDTOS); diff --git a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java index 2c748f59a..231456f4f 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationServiceImpl.java @@ -9,6 +9,7 @@ import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO; import com.engine.salary.entity.salaryitem.po.SalaryItemPO; import com.engine.salary.entity.salarysob.po.SalarySobPO; +import com.engine.salary.entity.taxagent.param.TaxAgentQueryParam; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationBO; import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam; @@ -366,19 +367,13 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration public boolean checkByAuthority(TaxDeclarationPO taxDeclarationPO, Long employeeId) { // 判断是否开启了分权 Boolean openDevolution = getTaxAgentService(user).isOpenDevolution(); - // 判断是否是总管理员 - Boolean isChief = getTaxAgentService(user).isChief(employeeId); - if (openDevolution && !isChief) { - // 查询负责管理的个税扣缴义务人 - Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(employeeId); - if (CollectionUtils.isEmpty(taxAgentPOS)) { - return false; - } - Set taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId); - return taxAgentIds.contains(taxDeclarationPO.getTaxAgentId()); - } - // 查询个税申报表 - return true; + // 获取所有个税扣缴义务人 + TaxAgentQueryParam param = TaxAgentQueryParam.builder().build(); + param.setFilterType(AuthFilterTypeEnum.ADMIN_DATA); + Collection taxAgentList = getTaxAgentService(user).listAuth(param); + + Set taxAgentIds = SalaryEntityUtil.properties(taxAgentList, TaxAgentPO::getId); + return taxAgentIds.contains(taxDeclarationPO.getTaxAgentId()); } @Override diff --git a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java index a4e3bf86f..7bceb9672 100644 --- a/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/AddUpDeductionWrapper.java @@ -126,9 +126,7 @@ public class AddUpDeductionWrapper extends Service { * @return */ public XSSFWorkbook downloadTemplate(AddUpDeductionQueryParam queryParam) { - // 构建异步导出参数 - boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); - return getAddUpDeductionService(user).downloadTemplate(isChief, queryParam); + return getAddUpDeductionService(user).downloadTemplate(queryParam); } diff --git a/src/com/engine/salary/wrapper/TaxAgentWrapper.java b/src/com/engine/salary/wrapper/TaxAgentWrapper.java index e528bbb77..2849139c3 100644 --- a/src/com/engine/salary/wrapper/TaxAgentWrapper.java +++ b/src/com/engine/salary/wrapper/TaxAgentWrapper.java @@ -116,8 +116,6 @@ public class TaxAgentWrapper extends Service { * @return */ public PageInfo> list(TaxAgentQueryParam queryParam) { - // 是否是总管理员 - Boolean isChief = getTaxAgentService(user).isChief((long) user.getUID()); // 是否开启分权 boolean isOpenDevolution = getTaxAgentBaseService(user).isOpenDevolution();