From 5ec4fc3516e4f18f405f3e9a09cad28016812687 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Fri, 3 Jan 2025 17:38:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E6=8A=A5=E8=A1=A8=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../param/OtherDeductionDetailQueryParam.java | 8 +++ .../impl/OtherDeductionServiceImpl.java | 63 ++++++++++++++++--- .../salary/web/OtherDeductionController.java | 1 - 3 files changed, 64 insertions(+), 8 deletions(-) diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java index c01fc3edd..e849daaa9 100644 --- a/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java @@ -1,11 +1,14 @@ package com.engine.salary.entity.datacollection.param; import com.engine.salary.common.BaseQueryParam; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Date; + /** * 其他免税扣除,附表查询列表 *

Copyright: Copyright (c) 2022

@@ -22,4 +25,9 @@ public class OtherDeductionDetailQueryParam extends BaseQueryParam { private Long id; + + private Long employeeId; + private Long taxAgentId; + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date taxCycle; } diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 30b393f4a..8d838f3ed 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -2248,7 +2248,14 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction @Override public PageInfo freeIncomeList(OtherDeductionDetailQueryParam param) { - List pos = getFreeIncomeMapper().listSome(FreeIncomePO.builder().mainId(param.getId()).build()); + FreeIncomePO build; + if (param.getId() != null) { + build = FreeIncomePO.builder().mainId(param.getId()).build(); + } else { + build = FreeIncomePO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + List pos = getFreeIncomeMapper().listSome(build); + List empIds = SalaryEntityUtil.properties(pos, FreeIncomePO::getEmployeeId, Collectors.toList()); List employeeList = getSalaryEmployeeService(user).listByIds(empIds); Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); @@ -2272,7 +2279,14 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction @Override public PageInfo derateDeductionList(OtherDeductionDetailQueryParam param) { - List pos = getDerateDeductionMapper().listSome(DerateDeductionPO.builder().mainId(param.getId()).build()); + DerateDeductionPO build; + if (param.getId() != null) { + build = DerateDeductionPO.builder().mainId(param.getId()).build(); + } else { + build = DerateDeductionPO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + + List pos = getDerateDeductionMapper().listSome(build); List empIds = SalaryEntityUtil.properties(pos, DerateDeductionPO::getEmployeeId, Collectors.toList()); List employeeList = getSalaryEmployeeService(user).listByIds(empIds); Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); @@ -2296,7 +2310,14 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction @Override public PageInfo endowmentInsuranceList(OtherDeductionDetailQueryParam param) { - List pos = getEndowmentInsuranceMapper().listSome(EndowmentInsurancePO.builder().mainId(param.getId()).build()); + EndowmentInsurancePO build; + if (param.getId() != null) { + build = EndowmentInsurancePO.builder().mainId(param.getId()).build(); + } else { + build = EndowmentInsurancePO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + + List pos = getEndowmentInsuranceMapper().listSome(build); List empIds = SalaryEntityUtil.properties(pos, EndowmentInsurancePO::getEmployeeId, Collectors.toList()); List employeeList = getSalaryEmployeeService(user).listByIds(empIds); Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); @@ -2320,7 +2341,14 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction @Override public PageInfo grantDonationList(OtherDeductionDetailQueryParam param) { - List pos = getGrantDonationMapper().listSome(GrantDonationPO.builder().mainId(param.getId()).build()); + GrantDonationPO build; + if (param.getId() != null) { + build = GrantDonationPO.builder().mainId(param.getId()).build(); + } else { + build = GrantDonationPO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + + List pos = getGrantDonationMapper().listSome(build); List empIds = SalaryEntityUtil.properties(pos, GrantDonationPO::getEmployeeId, Collectors.toList()); List employeeList = getSalaryEmployeeService(user).listByIds(empIds); Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); @@ -2344,7 +2372,14 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction @Override public PageInfo healthInsuranceList(OtherDeductionDetailQueryParam param) { - List pos = getHealthInsuranceMapper().listSome(HealthInsurancePO.builder().mainId(param.getId()).build()); + HealthInsurancePO build; + if (param.getId() != null) { + build = HealthInsurancePO.builder().mainId(param.getId()).build(); + } else { + build = HealthInsurancePO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + + List pos = getHealthInsuranceMapper().listSome(build); List empIds = SalaryEntityUtil.properties(pos, HealthInsurancePO::getEmployeeId, Collectors.toList()); List employeeList = getSalaryEmployeeService(user).listByIds(empIds); Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); @@ -2368,7 +2403,14 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction @Override public PageInfo otherDerateDeductionList(OtherDeductionDetailQueryParam param) { - List pos = getOtherDerateDeductionMapper().listSome(OtherDerateDeductionPO.builder().mainId(param.getId()).build()); + OtherDerateDeductionPO build; + if (param.getId() != null) { + build = OtherDerateDeductionPO.builder().mainId(param.getId()).build(); + } else { + build = OtherDerateDeductionPO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + + List pos = getOtherDerateDeductionMapper().listSome(build); List empIds = SalaryEntityUtil.properties(pos, OtherDerateDeductionPO::getEmployeeId, Collectors.toList()); List employeeList = getSalaryEmployeeService(user).listByIds(empIds); Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); @@ -2392,7 +2434,14 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction @Override public PageInfo personalPensionList(OtherDeductionDetailQueryParam param) { - List pos = getPersonalPensionMapper().listSome(PersonalPensionPO.builder().mainId(param.getId()).build()); + PersonalPensionPO build; + if (param.getId() != null) { + build = PersonalPensionPO.builder().mainId(param.getId()).build(); + } else { + build = PersonalPensionPO.builder().taxAgentId(param.getTaxAgentId()).taxYearMonth(param.getTaxCycle()).employeeId(param.getEmployeeId()).build(); + } + + List pos = getPersonalPensionMapper().listSome(build); List empIds = SalaryEntityUtil.properties(pos, PersonalPensionPO::getEmployeeId, Collectors.toList()); List employeeList = getSalaryEmployeeService(user).listByIds(empIds); Map employeeMap = SalaryEntityUtil.convert2Map(employeeList, DataCollectionEmployee::getEmployeeId); diff --git a/src/com/engine/salary/web/OtherDeductionController.java b/src/com/engine/salary/web/OtherDeductionController.java index 6a6bed689..fb40b0fff 100644 --- a/src/com/engine/salary/web/OtherDeductionController.java +++ b/src/com/engine/salary/web/OtherDeductionController.java @@ -536,5 +536,4 @@ public class OtherDeductionController { return new ResponseResult(user).run(getOtherDeductionWrapper(user)::deletePersonalPension, param); } - }