From 412d3488d1c853bd4270ad1034a3baace6b67dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 24 Dec 2024 10:54:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=8F=E5=85=8D=E7=A8=8E=E9=A2=9D=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=92=8C=E4=BF=9D=E5=AD=98=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/DM/sql202412240103.sql | 10 ++++++ resource/sqlupgrade/GS/sql202412240103.sql | 10 ++++++ resource/sqlupgrade/JC/sql202412240103.sql | 10 ++++++ resource/sqlupgrade/Mysql/sql202412240103.sql | 3 ++ .../sqlupgrade/Oracle/sql202412240103.sql | 9 +++++ resource/sqlupgrade/PG/sql202412240103.sql | 3 ++ .../sqlupgrade/SQLServer/sql202412240103.sql | 5 +++ resource/sqlupgrade/ST/sql202412240103.sql | 10 ++++++ .../param/FreeIncomeSaveParam.java | 19 +++++------ .../param/OtherDeductionDetailQueryParam.java | 25 ++++++++++++++ .../datacollection/po/DerateDeductionPO.java | 4 +++ .../po/EndowmentInsurancePO.java | 4 +++ .../datacollection/po/FreeIncomePO.java | 4 +++ .../datacollection/po/GrantDonationPO.java | 4 +++ .../datacollection/po/HealthInsurancePO.java | 4 +++ .../po/OtherDerateDeductionPO.java | 4 +++ .../datacollection/po/PersonalPensionPO.java | 4 +++ .../salary/service/OtherDeductionService.java | 3 ++ .../impl/OtherDeductionServiceImpl.java | 30 +++++++++++++---- .../salary/web/OtherDeductionController.java | 33 +++++++++++++++---- .../salary/wrapper/OtherDeductionWrapper.java | 9 +++++ 21 files changed, 183 insertions(+), 24 deletions(-) create mode 100644 resource/sqlupgrade/DM/sql202412240103.sql create mode 100644 resource/sqlupgrade/GS/sql202412240103.sql create mode 100644 resource/sqlupgrade/JC/sql202412240103.sql create mode 100644 resource/sqlupgrade/Mysql/sql202412240103.sql create mode 100644 resource/sqlupgrade/Oracle/sql202412240103.sql create mode 100644 resource/sqlupgrade/PG/sql202412240103.sql create mode 100644 resource/sqlupgrade/SQLServer/sql202412240103.sql create mode 100644 resource/sqlupgrade/ST/sql202412240103.sql create mode 100644 src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java diff --git a/resource/sqlupgrade/DM/sql202412240103.sql b/resource/sqlupgrade/DM/sql202412240103.sql new file mode 100644 index 000000000..3762c4a0d --- /dev/null +++ b/resource/sqlupgrade/DM/sql202412240103.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +); +/ + diff --git a/resource/sqlupgrade/GS/sql202412240103.sql b/resource/sqlupgrade/GS/sql202412240103.sql new file mode 100644 index 000000000..3762c4a0d --- /dev/null +++ b/resource/sqlupgrade/GS/sql202412240103.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +); +/ + diff --git a/resource/sqlupgrade/JC/sql202412240103.sql b/resource/sqlupgrade/JC/sql202412240103.sql new file mode 100644 index 000000000..3762c4a0d --- /dev/null +++ b/resource/sqlupgrade/JC/sql202412240103.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +); +/ + diff --git a/resource/sqlupgrade/Mysql/sql202412240103.sql b/resource/sqlupgrade/Mysql/sql202412240103.sql new file mode 100644 index 000000000..fb1d84ef2 --- /dev/null +++ b/resource/sqlupgrade/Mysql/sql202412240103.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_other_deduction +ADD COLUMN free_income varchar(255) , +ADD COLUMN derate_deduction varchar(255) ; \ No newline at end of file diff --git a/resource/sqlupgrade/Oracle/sql202412240103.sql b/resource/sqlupgrade/Oracle/sql202412240103.sql new file mode 100644 index 000000000..ca85eff16 --- /dev/null +++ b/resource/sqlupgrade/Oracle/sql202412240103.sql @@ -0,0 +1,9 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +) +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +) +/ \ No newline at end of file diff --git a/resource/sqlupgrade/PG/sql202412240103.sql b/resource/sqlupgrade/PG/sql202412240103.sql new file mode 100644 index 000000000..4820d7cee --- /dev/null +++ b/resource/sqlupgrade/PG/sql202412240103.sql @@ -0,0 +1,3 @@ +ALTER TABLE hrsa_other_deduction ADD COLUMN free_income varchar(255) NULL; + +ALTER TABLE hrsa_other_deduction ADD COLUMN derate_deduction varchar(255) NULL; \ No newline at end of file diff --git a/resource/sqlupgrade/SQLServer/sql202412240103.sql b/resource/sqlupgrade/SQLServer/sql202412240103.sql new file mode 100644 index 000000000..cfb59073c --- /dev/null +++ b/resource/sqlupgrade/SQLServer/sql202412240103.sql @@ -0,0 +1,5 @@ +ALTER TABLE hrsa_other_deduction ADD free_income varchar(255) NULL +GO + +ALTER TABLE hrsa_other_deduction ADD derate_deduction varchar(255) NULL +GO \ No newline at end of file diff --git a/resource/sqlupgrade/ST/sql202412240103.sql b/resource/sqlupgrade/ST/sql202412240103.sql new file mode 100644 index 000000000..3762c4a0d --- /dev/null +++ b/resource/sqlupgrade/ST/sql202412240103.sql @@ -0,0 +1,10 @@ +ALTER TABLE hrsa_other_deduction ADD ( + free_income varchar2(255) NULL +); +/ + +ALTER TABLE hrsa_other_deduction ADD ( + derate_deduction varchar2(255) NULL +); +/ + diff --git a/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java b/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java index 70e05f6bc..c75354b73 100644 --- a/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java +++ b/src/com/engine/salary/entity/datacollection/param/FreeIncomeSaveParam.java @@ -5,8 +5,6 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import java.util.Date; - /** * 其他免税扣除-免税收入表单 *

Copyright: Copyright (c) 2024

@@ -28,14 +26,15 @@ public class FreeIncomeSaveParam { //主表数据Id private Long mainId; - //税款所属期 - private Date taxYearMonth; - - //人员 - private Long employeeId; - - //个税扣缴义务人 - private Long taxAgentId; +// //税款所属期 +// @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") +// private Date taxYearMonth; +// +// //人员 +// private Long employeeId; +// +// //个税扣缴义务人 +// private Long taxAgentId; //免税事项 private String freeItem; diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java new file mode 100644 index 000000000..c01fc3edd --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionDetailQueryParam.java @@ -0,0 +1,25 @@ +package com.engine.salary.entity.datacollection.param; + +import com.engine.salary.common.BaseQueryParam; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 其他免税扣除,附表查询列表 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class OtherDeductionDetailQueryParam extends BaseQueryParam { + + private Long id; + +} diff --git a/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java index d27f93e59..5d94d3627 100644 --- a/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/DerateDeductionPO.java @@ -8,6 +8,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -74,4 +75,7 @@ public class DerateDeductionPO{ @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + + //主键id + private Collection ids; } diff --git a/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java b/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java index 1688dbcf9..9bb444ebe 100644 --- a/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java +++ b/src/com/engine/salary/entity/datacollection/po/EndowmentInsurancePO.java @@ -7,6 +7,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -83,4 +84,7 @@ public class EndowmentInsurancePO { @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + //主键id + private Collection ids; + } diff --git a/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java index cd017fa54..085b7f751 100644 --- a/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java +++ b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java @@ -7,6 +7,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -73,4 +74,7 @@ public class FreeIncomePO { @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + + //主键id + private Collection ids; } diff --git a/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java b/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java index d85239da4..f65f73caa 100644 --- a/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java +++ b/src/com/engine/salary/entity/datacollection/po/GrantDonationPO.java @@ -7,6 +7,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -84,4 +85,7 @@ public class GrantDonationPO { @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + //主键id + private Collection ids; + } diff --git a/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java b/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java index c27dc5061..86152ffef 100644 --- a/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java +++ b/src/com/engine/salary/entity/datacollection/po/HealthInsurancePO.java @@ -7,6 +7,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -78,4 +79,7 @@ public class HealthInsurancePO { @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + + //主键id + private Collection ids; } diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java index 2396dd973..74f403bab 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java @@ -7,6 +7,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -70,4 +71,7 @@ public class OtherDerateDeductionPO { @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + + //主键id + private Collection ids; } diff --git a/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java b/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java index 6af983b1f..8732c4af5 100644 --- a/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/PersonalPensionPO.java @@ -8,6 +8,7 @@ import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Collection; import java.util.Date; /** @@ -89,4 +90,7 @@ public class PersonalPensionPO{ @ElogTransform(name = "租户key", ignore = true) private String tenantKey; + + //主键id + private Collection ids; } diff --git a/src/com/engine/salary/service/OtherDeductionService.java b/src/com/engine/salary/service/OtherDeductionService.java index f2f8b2efa..9b7875f76 100644 --- a/src/com/engine/salary/service/OtherDeductionService.java +++ b/src/com/engine/salary/service/OtherDeductionService.java @@ -1,5 +1,6 @@ package com.engine.salary.service; +import com.engine.salary.entity.datacollection.dto.FreeIncomeListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.*; @@ -125,6 +126,8 @@ public interface OtherDeductionService { String extendToLastMonth(OtherDeductionExtendLastParam param); + PageInfo freeIncomeList(OtherDeductionDetailQueryParam param); + /** * 保存免税收入 * @param param diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index c8d98a3f8..62eb03d76 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -51,6 +51,7 @@ import org.apache.commons.lang3.Validate; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.util.IOUtils; import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.beans.BeanUtils; import weaver.file.ImageFileManager; import weaver.general.Util; import weaver.hrm.User; @@ -2182,14 +2183,17 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction public void saveFreeIncome(FreeIncomeSaveParam param) { Date now = new Date(); + Long mainId = param.getMainId(); + OtherDeductionPO deductionPO = getOtherDeductionMapper().getById(mainId); + Long id = param.getId(); if (id == null) { FreeIncomePO po = FreeIncomePO.builder() .id(id) - .mainId(param.getMainId()) - .taxYearMonth(param.getTaxYearMonth()) - .employeeId(param.getEmployeeId()) - .taxAgentId(param.getTaxAgentId()) + .mainId(mainId) + .taxYearMonth(deductionPO.getDeclareMonth()) + .employeeId(deductionPO.getEmployeeId()) + .taxAgentId(deductionPO.getTaxAgentId()) .freeItem(param.getFreeItem()) .freeProperty(param.getFreeProperty()) .freeAmount(param.getFreeAmount()) @@ -2205,9 +2209,9 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } else { FreeIncomePO po = getFreeIncomeMapper().getById(id); - po.setTaxYearMonth(param.getTaxYearMonth()); - po.setEmployeeId(param.getEmployeeId()); - po.setTaxAgentId(param.getTaxAgentId()); +// po.setTaxYearMonth(param.getTaxYearMonth()); +// po.setEmployeeId(param.getEmployeeId()); +// po.setTaxAgentId(param.getTaxAgentId()); po.setFreeItem(param.getFreeItem()); po.setFreeProperty(param.getFreeProperty()); po.setFreeAmount(param.getFreeAmount()); @@ -2218,4 +2222,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } } + @Override + public PageInfo freeIncomeList(OtherDeductionDetailQueryParam param) { + + List freeIncomePOS = getFreeIncomeMapper().listSome(FreeIncomePO.builder().mainId(param.getId()).build()); + List listDTOS = freeIncomePOS.stream().map(po -> { + FreeIncomeListDTO freeIncomeListDTO = new FreeIncomeListDTO(); + BeanUtils.copyProperties(po, freeIncomeListDTO); + return freeIncomeListDTO; + }).collect(Collectors.toList()); + return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, FreeIncomeListDTO.class); + } + } diff --git a/src/com/engine/salary/web/OtherDeductionController.java b/src/com/engine/salary/web/OtherDeductionController.java index 251507f68..f041392ee 100644 --- a/src/com/engine/salary/web/OtherDeductionController.java +++ b/src/com/engine/salary/web/OtherDeductionController.java @@ -1,6 +1,7 @@ package com.engine.salary.web; import com.engine.common.util.ServiceUtil; +import com.engine.salary.entity.datacollection.dto.FreeIncomeListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.*; @@ -279,8 +280,8 @@ public class OtherDeductionController { } /** - * @description 编辑其他免税扣除 * @return String + * @description 编辑其他免税扣除 * @author Harryxzy * @date 2022/10/26 9:41 */ @@ -293,8 +294,8 @@ public class OtherDeductionController { } /** - * @description 获取其他免税扣除数据 * @return String + * @description 获取其他免税扣除数据 * @author Harryxzy * @date 2022/10/31 13:42 */ @@ -307,8 +308,8 @@ public class OtherDeductionController { } /** - * @description 新建其他免税扣除 * @return String + * @description 新建其他免税扣除 * @author Harryxzy * @date 2022/10/27 14:41 */ @@ -321,8 +322,8 @@ public class OtherDeductionController { } /** - * @description 删除所选其他免税扣除 * @return String + * @description 删除所选其他免税扣除 * @author Harryxzy * @date 2022/10/27 14:41 */ @@ -335,8 +336,8 @@ public class OtherDeductionController { } /** - * @description 一键清空其他免税扣除 * @return null + * @description 一键清空其他免税扣除 * @author Harryxzy * @date 2022/10/27 15:15 */ @@ -351,9 +352,27 @@ public class OtherDeductionController { @POST @Path("/extendToLastMonth") @Produces(MediaType.APPLICATION_JSON) - public String extendToLastMonth(@Context HttpServletRequest request, @Context HttpServletResponse response, - @RequestBody OtherDeductionExtendLastParam param) { + public String extendToLastMonth(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionExtendLastParam param) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult(user).run(getOtherDeductionWrapper(user)::extendToLastMonth, param); } + + //减免税额列表 + @POST + @Path("/freeIncomeList") + @Produces(MediaType.APPLICATION_JSON) + public String detailList(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody OtherDeductionDetailQueryParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult>(user).run(getOtherDeductionWrapper(user)::freeIncomeList, param); + } + + @POST + @Path("/saveFreeIncome") + @Produces(MediaType.APPLICATION_JSON) + public String saveFreeIncome(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody FreeIncomeSaveParam param) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOtherDeductionWrapper(user)::saveFreeIncome, param); + } + + } diff --git a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java index f8a261828..d8e87a630 100644 --- a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java @@ -6,6 +6,7 @@ import com.api.browser.util.ConditionFactory; import com.api.browser.util.ConditionType; import com.engine.common.util.ServiceUtil; import com.engine.core.impl.Service; +import com.engine.salary.entity.datacollection.dto.FreeIncomeListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionListDTO; import com.engine.salary.entity.datacollection.dto.OtherDeductionRecordDTO; import com.engine.salary.entity.datacollection.param.*; @@ -288,4 +289,12 @@ public class OtherDeductionWrapper extends Service { param.setYearMonthTime(localDate); return getOtherDeductionService(user).extendToLastMonth(param); } + + public PageInfo freeIncomeList(OtherDeductionDetailQueryParam param) { + return getOtherDeductionService(user).freeIncomeList(param); + } + + public void saveFreeIncome(FreeIncomeSaveParam param) { + getOtherDeductionService(user).saveFreeIncome(param); + } }