diff --git a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateListDTO.java b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateListDTO.java index 60182ae3f..887f36905 100644 --- a/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateListDTO.java +++ b/src/com/engine/salary/entity/salaryBill/dto/SalaryTemplateListDTO.java @@ -54,4 +54,7 @@ public class SalaryTemplateListDTO { @SalaryTableColumn(text = "备注", width = "20%", column = "description") @TableTitle(title = "备注", dataIndex = "description", key = "description") private String description; + + // 薪资账套id + private Long salarySobId; } diff --git a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml index 17e371c33..9912f302d 100644 --- a/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml +++ b/src/com/engine/salary/mapper/salarybill/SalaryTemplateMapper.xml @@ -366,7 +366,8 @@ t.replenish_name as replenishName, s.name as salarysob, t.use_type as useType, - t.description + t.description, + t.salary_sob_id from hrsa_salary_template t left join hrsa_salary_sob s on t.salary_sob_id = s.id where t.delete_type = 0 @@ -398,7 +399,8 @@ t.replenish_name as replenishName, s.name as salarysob, t.use_type as useType, - t.description + t.description, + t.salary_sob_id from hrsa_salary_template t left join hrsa_salary_sob s on t.salary_sob_id = s.id where t.delete_type = 0 @@ -430,7 +432,8 @@ t.replenish_name as replenishName, s.name as salarysob, t.use_type as useType, - t.description + t.description, + t.salary_sob_id from hrsa_salary_template t left join hrsa_salary_sob s on t.salary_sob_id = s.id where t.delete_type = 0 diff --git a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java index 43168124a..8b8da3b77 100644 --- a/src/com/engine/salary/service/impl/SIAccountServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIAccountServiceImpl.java @@ -232,6 +232,7 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { Long employeeId = (long) user.getUID(); Map datas = new HashMap<>(); + List paymentOrganizationIds = queryParam.getTaxAgents(); // 分权逻辑 Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); if (needAuth) { @@ -240,7 +241,8 @@ public class SIAccountServiceImpl extends Service implements SIAccountService { if (CollectionUtils.isEmpty(taxAgents)) { //防止普通用户查询 queryParam.setTaxAgents(Collections.singletonList(-1L)); - } else { + } else if (paymentOrganizationIds != null && paymentOrganizationIds.size() > 0){ + taxAgents.retainAll(paymentOrganizationIds); queryParam.setTaxAgents(taxAgents); } } diff --git a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java index 8738c66f9..071dde24e 100644 --- a/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java +++ b/src/com/engine/salary/service/impl/SIArchivesServiceImpl.java @@ -1159,6 +1159,20 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService public PageInfo historyListByEmployeeIdAndOperator(SIArchiveBaseHistoryListParam param) { List adjustHistoryDTOS = siArchivesBiz.getBaseHistoryByEmployeeIdAndOperator(param.getOperator(), param.getEmployeeId()); + + // 分权逻辑 + Boolean needAuth = getTaxAgentService(user).isNeedAuth((long) user.getUID()); + if (needAuth) { + Collection taxAgentPOS = getTaxAgentService(user).listAllTaxAgents((long) user.getUID()); + List taxAgents = taxAgentPOS.stream().map(TaxAgentPO::getId).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(taxAgents)) { + //防止普通用户查询 + adjustHistoryDTOS = new ArrayList<>(); + } else { + adjustHistoryDTOS = adjustHistoryDTOS.stream().filter(f -> taxAgents.contains(f.getPaymentOrganization())).collect(Collectors.toList()); + } + } + adjustHistoryDTOS.forEach(f -> { if (StringUtils.isNotBlank(f.getPaymentScope())) { if(f.getPaymentScope().equals(PaymentScopeEnum.SCOPE_PERSON.getValue().toString())) {