From 4da07b9e8071a3229819860fa5ebe9aa4552b57b Mon Sep 17 00:00:00 2001 From: sy Date: Wed, 24 Jan 2024 14:35:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E9=85=AC=E7=B3=BB=E7=BB=9F-=E7=A6=8F?= =?UTF-8?q?=E5=88=A9=E6=A1=A3=E6=A1=88=E3=80=81=E5=8F=B0=E8=B4=A6=EF=BC=8C?= =?UTF-8?q?=E5=9F=BA=E6=95=B0=E8=B0=83=E6=95=B4=E8=AE=B0=E5=BD=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2=E5=A2=9E=E5=8A=A0=E5=88=86=E6=9D=83?= =?UTF-8?q?=EF=BC=8C=E5=8F=B0=E8=B4=A6=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E4=B8=AA=E7=A8=8E=E6=89=A3=E7=BC=B4=E4=B9=89?= =?UTF-8?q?=E5=8A=A1=E4=BA=BA=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../salaryBill/dto/SalaryTemplateListDTO.java | 3 +++ .../mapper/salarybill/SalaryTemplateMapper.xml | 9 ++++++--- .../salary/service/impl/SIAccountServiceImpl.java | 4 +++- .../salary/service/impl/SIArchivesServiceImpl.java | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 4 deletions(-) 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())) {