diff --git a/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java new file mode 100644 index 000000000..c761c4971 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/DerateDeductionListDTO.java @@ -0,0 +1,102 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.hrmelog.annotation.ElogTransform; +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 免税收入 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DerateDeductionListDTO { + + private Long id; + + private Long mainId; + + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + + private Long employeeId; + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + //部门 + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @ExcelProperty(index = 5) + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + private String idNo; + + + @ExcelProperty(index = 6) + @TableTitle(title = "减免事项", dataIndex = "derateItem", key = "derateItem") + private String derateItem; + + @ExcelProperty(index = 8) + @TableTitle(title = "减免性质", dataIndex = "derateProperty", key = "derateProperty") + @ElogTransform(name = "减免性质") + private String derateProperty; + + @ExcelProperty(index = 9) + @TableTitle(title = "减免金额", dataIndex = "derateAmount", key = "derateAmount") + @ElogTransform(name = "减免金额") + private String derateAmount; + + + + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java new file mode 100644 index 000000000..cfd7e773d --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/EndowmentInsuranceListDTO.java @@ -0,0 +1,106 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 免税收入 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class EndowmentInsuranceListDTO { + + private Long id; + + private Long mainId; + + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + + private Long employeeId; + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + //部门 + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @ExcelProperty(index = 5) + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + private String idNo; + + + @ExcelProperty(index = 6) + @TableTitle(title = "税延养老账户编号", dataIndex = "accountNumber", key = "accountNumber") + private String accountNumber; + + @ExcelProperty(index = 7) + @TableTitle(title = "报税校验码", dataIndex = "checkCode", key = "checkCode") + private String checkCode; + + @ExcelProperty(index = 8) + @TableTitle(title = "年度保费", dataIndex = "yearPremium", key = "yearPremium") + private String yearPremium; + + @ExcelProperty(index = 9) + @TableTitle(title = "月度保费", dataIndex = "monthPremium", key = "monthPremium") + private String monthPremium; + + @ExcelProperty(index = 10) + @TableTitle(title = "本期扣除金额", dataIndex = "currentDeduction", key = "currentDeduction") + private String currentDeduction; + + + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java b/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java new file mode 100644 index 000000000..a8e132c47 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/FreeIncomeListDTO.java @@ -0,0 +1,100 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.Encrypt; +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 免税收入 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FreeIncomeListDTO { + + private Long id; + + private Long mainId; + + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + + private Long employeeId; + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + //部门 + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @ExcelProperty(index = 5) + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + private String idNo; + + + @ExcelProperty(index = 6) + @TableTitle(title = "免税事项", dataIndex = "freeItem", key = "freeItem") + private String freeItem; + + @ExcelProperty(index = 7) + @TableTitle(title = "免税性质", dataIndex = "freeProperty", key = "freeProperty") + private String freeProperty; + + @ExcelProperty(index = 8) + @TableTitle(title = "免税金额", dataIndex = "freeAmount", key = "freeAmount") + @Encrypt + private String freeAmount; + + + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java b/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java new file mode 100644 index 000000000..a6fd88268 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/GrantDonationListDTO.java @@ -0,0 +1,121 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 准予扣除的捐赠额 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class GrantDonationListDTO { + + private Long id; + + private Long mainId; + + + private Long employeeId; + + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @SalaryTableColumn(text = "姓名", width = "10%", column = "username") + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @SalaryTableColumn(text = "个税扣缴义务人", width = "10%", column = "taxAgentName") + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + //部门 + @SalaryTableColumn(text = "部门", width = "10%", column = "departmentName") + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @SalaryTableColumn(text = "手机号", width = "10%", column = "mobile") + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @SalaryTableColumn(text = "工号", width = "10%", column = "jobNum") + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @SalaryTableColumn(text = "证件号码", width = "10%", column = "idNo") + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + @ExcelProperty(index = 5) + private String idNo; + + + @ExcelProperty(index = 6) + @TableTitle(title = "受赠单位名称", dataIndex = "recipientName", key = "recipientName") + private String recipientName; + + @ExcelProperty(index = 7) + @TableTitle(title = "受赠单位纳税人识别号", dataIndex = "taxCode", key = "taxCode") + private String taxCode; + + @ExcelProperty(index = 8) + @TableTitle(title = "捐赠凭证号", dataIndex = "donationNumber", key = "donationNumber") + private String donationNumber; + + @ExcelProperty(index = 9) + @TableTitle(title = "捐赠日期", dataIndex = "donateDate", key = "donateDate") + private Date donateDate; + + @ExcelProperty(index = 10) + @TableTitle(title = "捐赠金额", dataIndex = "donateAmount", key = "donateAmount") + private String donateAmount; + + @ExcelProperty(index = 11) + @TableTitle(title = "扣除比例", dataIndex = "deductionProportion", key = "deductionProportion") + private String deductionProportion; + + @ExcelProperty(index = 12) + @TableTitle(title = "实际扣除金额", dataIndex = "actualDeduction", key = "actualDeduction") + private String actualDeduction; + + + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java b/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java new file mode 100644 index 000000000..5790a528e --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/HealthInsuranceListDTO.java @@ -0,0 +1,108 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 商业健康保险 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class HealthInsuranceListDTO { + + private Long id; + + private Long mainId; + + + private Long employeeId; + + + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + //部门 + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @SalaryTableColumn(text = "证件号码", width = "10%", column = "idNo") + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + @ExcelProperty(index = 5) + private String idNo; + + @ExcelProperty(index = 6) + @TableTitle(title = "税优识别码", dataIndex = "identificationNumber", key = "identificationNumber") + private String identificationNumber; + + @ExcelProperty(index = 7) + @TableTitle(title = "保单生效日期", dataIndex = "effectiveDate", key = "effectiveDate") + private Date effectiveDate; + + @ExcelProperty(index = 8) + @TableTitle(title = "年度保费", dataIndex = "yearPremium", key = "yearPremium") + + private String yearPremium; + + @ExcelProperty(index = 9) + @TableTitle(title = "月度保费", dataIndex = "monthPremium", key = "monthPremium") + private String monthPremium; + + @ExcelProperty(index = 10) + @TableTitle(title = "本期扣除金额", dataIndex = "currentDeduction", key = "currentDeduction") + private String currentDeduction; + + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java index abfffc82f..aaa2b4109 100644 --- a/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDeductionListDTO.java @@ -90,42 +90,44 @@ public class OtherDeductionListDTO { @TableTitle(title = "免税收入", dataIndex = "freeIncome", key = "freeIncome") private String freeIncome; - /** - * 减免税额 - */ - @ExcelProperty(index = 8) - @SalaryTableColumn(text = "入职日期", width = "10%", column = "derateDeduction") - @TableTitle(title = "减免税额", dataIndex = "derateDeduction", key = "derateDeduction") - private String derateDeduction; + //商业健康保险 - @ExcelProperty(index = 9) + @ExcelProperty(index = 8) @SalaryTableColumn(text = "商业健康保险", width = "10%", column = "businessHealthyInsurance") @TableTitle(title = "商业健康保险", dataIndex = "businessHealthyInsurance", key = "businessHealthyInsurance") @Encrypt private String businessHealthyInsurance; //税延养老保险 - @ExcelProperty(index = 10) + @ExcelProperty(index = 9) @SalaryTableColumn(text = "税延养老保险", width = "10%", column = "taxDelayEndowmentInsurance") @TableTitle(title = "税延养老保险", dataIndex = "taxDelayEndowmentInsurance", key = "taxDelayEndowmentInsurance") @Encrypt private String taxDelayEndowmentInsurance; - //其他 - @ExcelProperty(index = 11) - @SalaryTableColumn(text = "其他", width = "10%", column = "otherDeduction") - @TableTitle(title = "其他", dataIndex = "otherDeduction", key = "otherDeduction") - @Encrypt - private String otherDeduction; - //准予扣除的捐赠额 - @ExcelProperty(index = 12) + @ExcelProperty(index = 10) @SalaryTableColumn(text = "准予扣除的捐赠额", width = "10%", column = "deductionAllowedDonation") @TableTitle(title = "准予扣除的捐赠额", dataIndex = "deductionAllowedDonation", key = "deductionAllowedDonation") @Encrypt private String deductionAllowedDonation; + /** + * 减免税额 + */ + @ExcelProperty(index = 11) + @SalaryTableColumn(text = "减免税额", width = "10%", column = "derateDeduction") + @TableTitle(title = "减免税额", dataIndex = "derateDeduction", key = "derateDeduction") + private String derateDeduction; + + //其他 + @ExcelProperty(index = 12) + @SalaryTableColumn(text = "其他", width = "10%", column = "otherDeduction") + @TableTitle(title = "其他", dataIndex = "otherDeduction", key = "otherDeduction") + @Encrypt + private String otherDeduction; + @ExcelProperty(index = 13) @SalaryTableColumn(text = "个人养老金", width = "10%", column = "privatePension") @TableTitle(title = "个人养老金", dataIndex = "privatePension", key = "privatePension") diff --git a/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java b/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java new file mode 100644 index 000000000..42cff95a6 --- /dev/null +++ b/src/com/engine/salary/entity/datacollection/dto/OtherDerateDeductionListDTO.java @@ -0,0 +1,95 @@ +package com.engine.salary.entity.datacollection.dto; + +import com.engine.salary.annotation.I18n; +import com.engine.salary.annotation.SalaryTableColumn; +import com.engine.salary.annotation.TableTitle; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; +import com.engine.salary.util.excel.ExcelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 商业健康保险 + *

Copyright: Copyright (c) 2022

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class OtherDerateDeductionListDTO { + + private Long id; + + private Long mainId; + + + private Long employeeId; + + + /** + * 人员类型 + * + * @see DataCollectionEmployeeTypeEnum + */ + private Integer employeeType; + + @TableTitle(title = "税款所属期", dataIndex = "taxYearMonth", key = "taxYearMonth") + private Date taxYearMonth; + + //姓名 + @TableTitle(title = "姓名", dataIndex = "username", key = "username") + @ExcelProperty(index = 0) + @I18n + private String username; + + //个税扣缴义务人 + @TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName") + @ExcelProperty(index = 1) + private String taxAgentName; + + /** + * 个税扣缴义务人id + */ + private Long taxAgentId; + + //部门 + @TableTitle(title = "部门", dataIndex = "departmentName", key = "departmentName") + @ExcelProperty(index = 2) + @I18n + private String departmentName; + + //手机号 + @TableTitle(title = "手机号", dataIndex = "mobile", key = "mobile") + @ExcelProperty(index = 3) + private String mobile; + + //工号 + @TableTitle(title = "工号", dataIndex = "jobNum", key = "jobNum") + @ExcelProperty(index = 4) + private String jobNum; + + //证件号码 + @SalaryTableColumn(text = "证件号码", width = "10%", column = "idNo") + @TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo") + @ExcelProperty(index = 5) + private String idNo; + + @ExcelProperty(index = 6) + @TableTitle(title = "减免税额", dataIndex = "otherDeduction", key = "otherDeduction") + private String otherDeduction; + + @ExcelProperty(index = 7) + @TableTitle(title = "备注", dataIndex = "remark", key = "remark") + private String remark; + + @TableTitle(title = "操作", dataIndex = "operate", key = "operate") + private String operate; +} diff --git a/src/com/engine/salary/entity/datacollection/param/OtherDeductionImportParam.java b/src/com/engine/salary/entity/datacollection/param/OtherDeductionImportParam.java index 3ac3a98c9..509f3f7cc 100644 --- a/src/com/engine/salary/entity/datacollection/param/OtherDeductionImportParam.java +++ b/src/com/engine/salary/entity/datacollection/param/OtherDeductionImportParam.java @@ -24,8 +24,4 @@ public class OtherDeductionImportParam { //税款所属期 String declareMonth; - - //个税扣缴义务人 - String taxAgentId; - } diff --git a/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java index 59aa0afd6..cd017fa54 100644 --- a/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java +++ b/src/com/engine/salary/entity/datacollection/po/FreeIncomePO.java @@ -23,7 +23,7 @@ import java.util.Date; @AllArgsConstructor //hrsa_free_income @ElogTransform(name = "其他免税扣除-免税收入") -public class FreeIncomePO { +public class FreeIncomePO { @ElogTransform(name = "主键id") private Long id; @@ -53,6 +53,7 @@ public class FreeIncomePO { /** * 人员类型 + * * @see DataCollectionEmployeeTypeEnum */ @ElogTransform(name = "人员类型") diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java index 072f078fe..2d13dcced 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDeductionPO.java @@ -135,4 +135,9 @@ public class OtherDeductionPO { private List employeeIds; private Collection taxAgentIds; + /** + * 减免税额 + */ + private List freeIncomeList; + } \ No newline at end of file diff --git a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java index c9f86d3c6..2396dd973 100644 --- a/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java +++ b/src/com/engine/salary/entity/datacollection/po/OtherDerateDeductionPO.java @@ -10,7 +10,7 @@ import lombok.NoArgsConstructor; import java.util.Date; /** - * 其他免税扣除-减免税额 + * 其他免税扣除-其他 *

Copyright: Copyright (c) 2024

*

Company: 泛微软件

* @@ -22,7 +22,7 @@ import java.util.Date; @NoArgsConstructor @AllArgsConstructor //hrsa_other_derate_deduction -@ElogTransform(name = "其他免税扣除-减免税额") +@ElogTransform(name = "其他免税扣除-其他") public class OtherDerateDeductionPO { @ElogTransform(name = "主键id") private Long id; diff --git a/src/com/engine/salary/enums/datacollection/TaxFreeTypeEnum.java b/src/com/engine/salary/enums/datacollection/TaxFreeTypeEnum.java new file mode 100644 index 000000000..1edf03f98 --- /dev/null +++ b/src/com/engine/salary/enums/datacollection/TaxFreeTypeEnum.java @@ -0,0 +1,62 @@ +package com.engine.salary.enums.datacollection; + +import java.util.HashMap; +import java.util.Map; + +/** + * 免税归档状态 + *

Copyright: Copyright (c) 2024

+ *

Company: 泛微软件

+ * + * @author qiantao + * @version 1.0 + **/ +public enum TaxFreeTypeEnum { + + FREE_INCOME(32, "免税收入", 105147), + HEALTH_INSURANCE(16, "商业健康保险", 91238), + ENDOWMENT_INSURANCE(8, "税延养老保险", 91239), + GRANT_DONATION(4, "准予扣除的捐赠额", 91240), + DERATE_DEDUCTION(2, "减免税额", 102810), + OTHER_DERATE_DEDUCTION(1, "其他", 84500), + PERSONAL_PENSION(64, "个人养老金", 252256), + ; + + private final Integer value; + + private final String defaultLabel; + + private final Integer labelId; + + private static final Map VALUE_NAME_MAP; + + static { + final TaxFreeTypeEnum[] values = TaxFreeTypeEnum.values(); + VALUE_NAME_MAP = new HashMap<>(values.length); + for (TaxFreeTypeEnum value : values) { + VALUE_NAME_MAP.put(value.name(), value); + } + } + + TaxFreeTypeEnum(int value, String defaultLabel, int labelId) { + this.value = value; + this.defaultLabel = defaultLabel; + this.labelId = labelId; + } + + public String getDefaultLabel() { + return defaultLabel; + } + + public Integer getValue() { + return value; + } + + public Integer getLabelId() { + return labelId; + } + + public static TaxFreeTypeEnum parse(String defaultLabel) { + return VALUE_NAME_MAP.get(defaultLabel); + } +} diff --git a/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java new file mode 100644 index 000000000..35ca29ab5 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.java @@ -0,0 +1,73 @@ +package com.engine.salary.mapper.datacollection; + +import com.engine.salary.entity.datacollection.po.DerateDeductionPO; +import org.apache.ibatis.annotations.Param; + +import java.util.Collection; +import java.util.List; + +public interface DerateDeductionMapper { + + /** + * 查询所有记录 + * + * @return 返回集合,没有返回空List + */ + List listAll(); + + /** + * 条件查询 + * + * @return 返回集合,没有返回空List + */ + List listSome(DerateDeductionPO derateDeduction); + + + /** + * 根据主键查询 + * + * @param id 主键 + * @return 返回记录,没有返回null + */ + DerateDeductionPO getById(Long id); + + /** + * 新增,忽略null字段 + * + * @param derateDeduction 新增的记录 + * @return 返回影响行数 + */ + int insertIgnoreNull(DerateDeductionPO derateDeduction); + + + /** + * 修改,修改所有字段 + * + * @param derateDeduction 修改的记录 + * @return 返回影响行数 + */ + int update(DerateDeductionPO derateDeduction); + + /** + * 修改,忽略null字段 + * + * @param derateDeduction 修改的记录 + * @return 返回影响行数 + */ + int updateIgnoreNull(DerateDeductionPO derateDeduction); + + /** + * 删除记录 + * + * @param derateDeduction 待删除的记录 + * @return 返回影响行数 + */ + int delete(DerateDeductionPO derateDeduction); + + /** + * 批量删除记录 + * @param ids 主键id集合 + */ + void deleteByIds(@Param("ids") Collection ids); + +} \ No newline at end of file diff --git a/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml new file mode 100644 index 000000000..c6641f0d6 --- /dev/null +++ b/src/com/engine/salary/mapper/datacollection/DerateDeductionMapper.xml @@ -0,0 +1,313 @@ + + + + + + + + + + + + + + + + + + + + + + + + t.create_time + , t.creator + , t.delete_type + , t.derate_amount + , t.derate_item + , t.derate_property + , t.employee_id + , t.employee_type + , t.file_status + , t.id + , t.main_id + , t.tax_agent_id + , t.tax_year_month + , t.tenant_key + , t.update_time + + + + + + + + + + + + + + + INSERT INTO hrsa_derate_deduction + + + + create_time, + + + creator, + + + delete_type, + + + derate_amount, + + + derate_item, + + + derate_property, + + + employee_id, + + + employee_type, + + + file_status, + + + id, + + + main_id, + + + tax_agent_id, + + + tax_year_month, + + + tenant_key, + + + update_time, + + + + + #{createTime}, + + + #{creator}, + + + #{deleteType}, + + + #{derateAmount}, + + + #{derateItem}, + + + #{derateProperty}, + + + #{employeeId}, + + + #{employeeType}, + + + #{fileStatus}, + + + #{id}, + + + #{mainId}, + + + #{taxAgentId}, + + + #{taxYearMonth}, + + + #{tenantKey}, + + + #{updateTime}, + + + + + + + + + UPDATE hrsa_derate_deduction + + create_time=#{createTime}, + creator=#{creator}, + delete_type=#{deleteType}, + derate_amount=#{derateAmount}, + derate_item=#{derateItem}, + derate_property=#{derateProperty}, + employee_id=#{employeeId}, + employee_type=#{employeeType}, + file_status=#{fileStatus}, + main_id=#{mainId}, + tax_agent_id=#{taxAgentId}, + tax_year_month=#{taxYearMonth}, + tenant_key=#{tenantKey}, + update_time=#{updateTime}, + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_derate_deduction + + + create_time=#{createTime}, + + + creator=#{creator}, + + + delete_type=#{deleteType}, + + + derate_amount=#{derateAmount}, + + + derate_item=#{derateItem}, + + + derate_property=#{derateProperty}, + + + employee_id=#{employeeId}, + + + employee_type=#{employeeType}, + + + file_status=#{fileStatus}, + + + main_id=#{mainId}, + + + tax_agent_id=#{taxAgentId}, + + + tax_year_month=#{taxYearMonth}, + + + tenant_key=#{tenantKey}, + + + update_time=#{updateTime}, + + + WHERE id = #{id} AND delete_type = 0 + + + + + + UPDATE hrsa_derate_deduction + SET delete_type=1 + WHERE id = #{id} AND delete_type = 0 + + + + UPDATE hrsa_derate_deduction + SET delete_type = 1 + WHERE delete_type = 0 + AND id IN + + #{id} + + + + + + \ No newline at end of file diff --git a/src/com/engine/salary/service/OtherDeductionService.java b/src/com/engine/salary/service/OtherDeductionService.java index e77c70995..854286a0f 100644 --- a/src/com/engine/salary/service/OtherDeductionService.java +++ b/src/com/engine/salary/service/OtherDeductionService.java @@ -65,6 +65,13 @@ public interface OtherDeductionService { */ XSSFWorkbook downloadTemplate(OtherDeductionQueryParam param); + /** + * 下载明细模板 + * @param param + * @return + */ + XSSFWorkbook downloadDetailTemplate(OtherDeductionQueryParam param); + /** * 预览 */ @@ -75,7 +82,12 @@ public interface OtherDeductionService { */ Map importData(OtherDeductionImportParam importParam); - + /** + * 导入明细数据 + * @param importParam + * @return + */ + Map importDetailData(OtherDeductionImportParam importParam); /** * 获取其他免税扣除数据 diff --git a/src/com/engine/salary/service/TaxDeclarationApiConfigService.java b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java index c43db36c9..c239d6339 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiConfigService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiConfigService.java @@ -43,4 +43,10 @@ public interface TaxDeclarationApiConfigService { void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam); void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam); + + /** + * 是否开启智能算薪 + * @return + */ + boolean enableUse(); } diff --git a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java index 44c9f7148..ac1a306be 100644 --- a/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java +++ b/src/com/engine/salary/service/impl/OtherDeductionServiceImpl.java @@ -12,17 +12,20 @@ import com.engine.salary.constant.SalaryDefaultTenantConstant; import com.engine.salary.encrypt.EncryptUtil; import com.engine.salary.entity.datacollection.AddUpDeduction; import com.engine.salary.entity.datacollection.DataCollectionEmployee; +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.*; +import com.engine.salary.entity.datacollection.po.FreeIncomePO; import com.engine.salary.entity.datacollection.po.OtherDeductionPO; import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO; import com.engine.salary.entity.taxagent.dto.TaxAgentManageRangeEmployeeDTO; import com.engine.salary.entity.taxagent.po.TaxAgentPO; import com.engine.salary.enums.OperateTypeEnum; import com.engine.salary.enums.UserStatusEnum; +import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum; import com.engine.salary.exception.SalaryRunTimeException; -import com.engine.salary.mapper.datacollection.OtherDeductionMapper; +import com.engine.salary.mapper.datacollection.*; import com.engine.salary.mapper.sys.SalarySysConfMapper; import com.engine.salary.service.AddUpDeductionService; import com.engine.salary.service.OtherDeductionService; @@ -96,6 +99,33 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return ServiceUtil.getService(SalarySysConfServiceImpl.class, user); } + + private FreeIncomeMapper getFreeIncomeMapper() { + return MapperProxyFactory.getProxy(FreeIncomeMapper.class); + } + + private HealthInsuranceMapper getHealthInsuranceMapper() { + return MapperProxyFactory.getProxy(HealthInsuranceMapper.class); + } + + private EndowmentInsuranceMapper getEndowmentInsuranceMapper() { + return MapperProxyFactory.getProxy(EndowmentInsuranceMapper.class); + } + + private GrantDonationMapper getGrantDonationMapper() { + return MapperProxyFactory.getProxy(GrantDonationMapper.class); + } + + private DerateDeductionMapper getDerateDeductionMapper() { + return MapperProxyFactory.getProxy(DerateDeductionMapper.class); + } + + + private OtherDerateDeductionMapper getOtherDerateDeductionMapper() { + return MapperProxyFactory.getProxy(OtherDerateDeductionMapper.class); + } + + @Override public OtherDeductionPO getById(Long id) { return getOtherDeductionMapper().getById(id); @@ -200,13 +230,11 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction Validate.notBlank(imageId, "imageId为空"); //税款所属期 String declareMonthStr = Util.null2String(importParam.getDeclareMonth()); - //个税扣缴义务人 - String taxAgentId = Util.null2String(importParam.getTaxAgentId()); InputStream fileInputStream = null; try { fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); - List OtherDeductions = ExcelParseHelper.parse2Map(fileInputStream, OtherDeductionListDTO.class, 0, 1, 12, "OtherDeductionTemplate.xlsx"); + List OtherDeductions = ExcelParseHelper.parse2Map(fileInputStream, OtherDeductionListDTO.class, 0, 1, 14, "OtherDeductionTemplate.xlsx"); int total = OtherDeductions.size(); int index = 0; @@ -308,16 +336,8 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction } else { Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); if (optionalTemp.isPresent()) { - if (StringUtils.isNotEmpty(taxAgentId) && !optionalTemp.get().getTaxAgentId().equals(Long.valueOf(taxAgentId))) { - //个税扣缴义务人与导入时选择的不一致 - Map errorMessageMap = Maps.newHashMap(); - errorMessageMap.put("message", rowIndex + "个税扣缴义务人与导入时选择的不一致"); - errorData.add(errorMessageMap); - errorSum += 1; - } else { - po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); - taxAgentEmployees = optionalTemp.get().getEmployeeList(); - } + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + taxAgentEmployees = optionalTemp.get().getEmployeeList(); } else { //个税扣缴义务人不存在 Map errorMessageMap = Maps.newHashMap(); @@ -387,6 +407,192 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return apidatas; } + @Override + public Map importDetailData(OtherDeductionImportParam importParam) { + + long currentEmployeeId = user.getUID(); + Map apidatas = new HashMap(); + OtherDeductionBiz OtherDeductionBiz = new OtherDeductionBiz(); + + //查询对于人员信息导入筛选的全局配置 + SalarySysConfPO salarySysConfPO = getSalarySysConfMapper().getOneByCode("matchEmployeeMode"); + String confValue = (salarySysConfPO != null && salarySysConfPO.getConfValue() != null && !"".equals(salarySysConfPO.getConfValue())) ? salarySysConfPO.getConfValue() : "0"; + + //检验参数 + checkImportParam(importParam); + + //excel文件id + String imageId = Util.null2String(importParam.getImageId()); + Validate.notBlank(imageId, "imageId为空"); + //税款所属期 + String declareMonthStr = Util.null2String(importParam.getDeclareMonth()); + + InputStream fileInputStream = null; + + try { + fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(imageId)); + + int successCount = 0; + int errorCount = 0; + + //人员信息 + List employees = getSalaryEmployeeService(user).listEmployee(); + // 获取所有个税扣缴义务人 + Collection taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId); + //税款所属期 + Date declareMonth = SalaryDateUtil.stringToDate(declareMonthStr + "-01"); + // 获取已经核算的数据 + List salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr); + // 查询已有数据 + List list = getOtherDeductionMapper().listSome(OtherDeductionPO.builder().declareMonth(declareMonth).build()); + + // 错误excel内容 + List errorData = new ArrayList<>(); + + List eligibleData = new ArrayList<>(); + //免税收入 + List freeIncomeList = ExcelParseHelper.parse2Map(fileInputStream, FreeIncomeListDTO.class, 0, 1, 9, "OtherDeductionTemplate.xlsx"); + for (int i = 0; i < freeIncomeList.size(); i++) { + FreeIncomeListDTO dto = freeIncomeList.get(i); + + Date now = new Date(); + //待插入数据库对象 + OtherDeductionPO po = OtherDeductionPO.builder() + .declareMonth(declareMonth) + .freeIncomeList(new ArrayList<>()) + .createTime(now) + .updateTime(now) + .creator((long) user.getUID()) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + FreeIncomePO freeIncomePO = FreeIncomePO.builder() + .taxYearMonth(declareMonth) + .fileStatus(1) + .creator((long) user.getUID()) + .createTime(now) + .updateTime(now) + .tenantKey(DEFAULT_TENANT_KEY) + .build(); + + //异常点数量 + int errorSum = 0; + + //行号 + String rowIndex = String.format("第%s行", i + 2); + + //相同的姓名 + String userName = dto.getUsername(); + String deparmentName = dto.getDepartmentName(); + String mobile = dto.getMobile(); + String workcode = dto.getJobNum(); + String idNo = dto.getIdNo(); + List employeeSameIds = new ArrayList<>(); + + //筛选导入人员信息可以在人力资源池中匹配到的人员信息 + List emps = getSalaryEmployeeService(user).matchImportEmployee(confValue, employees, userName, deparmentName, mobile, workcode, idNo, null); + //含在职和离职,选在职数据 + if (CollectionUtils.isNotEmpty(emps) && emps.size() > 1) { + employeeSameIds = emps.stream() + .filter(e -> UserStatusEnum.getNormalStatus().contains(e.getStatus())) + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + if (CollectionUtils.isNotEmpty(emps) && emps.size() == 1) { + employeeSameIds = emps.stream() + .map(DataCollectionEmployee::getEmployeeId) + .collect(Collectors.toList()); + } + + //当人员信息导入筛选的全局配置为"0"时,姓名才是必填项 + if (StringUtils.isBlank(userName) && "0".equals(confValue)) { + //姓名 不能为空 + //错误消息对象 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) { + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "员工信息不存在或者存在多个员工"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null; + if (employeeId != null && employeeId > 0) { + po.setEmployeeId(employeeId); + freeIncomePO.setEmployeeId(employeeId); + freeIncomePO.setEmployeeType(DataCollectionEmployeeTypeEnum.ORGANIZATION.getValue()); + } else { + //姓名错误,系统内不存在该姓名 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "姓名错误,系统内不存在该姓名"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + + String taxAgentName = dto.getTaxAgentName(); + if (StringUtils.isBlank(taxAgentName)) { + //个税扣缴义务人不能为空 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不能为空"); + errorData.add(errorMessageMap); + errorSum += 1; + } else { + Optional optionalTemp = taxAgentList.stream().filter(m -> m.getTaxAgentName().equals(taxAgentName)).findFirst(); + if (optionalTemp.isPresent()) { + po.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + freeIncomePO.setTaxAgentId(optionalTemp.get().getTaxAgentId()); + } else { + //个税扣缴义务人不存在 + Map errorMessageMap = Maps.newHashMap(); + errorMessageMap.put("message", rowIndex + "个税扣缴义务人不存在或不在权限范围内"); + errorData.add(errorMessageMap); + errorSum += 1; + } + } + + //免税收入 + String freeIncome = dto.getFreeItem(); + String freeProperty = dto.getFreeProperty(); + String freeAmount = dto.getFreeAmount(); + freeIncomePO.setFreeItem(freeIncome); + freeIncomePO.setFreeProperty(freeProperty); + freeIncomePO.setFreeAmount(freeAmount); + + + if (errorSum == 0) { + successCount += 1; + String key = po.getEmployeeId() + "-" + po.getTaxAgentId(); + Map deductionPOMap = SalaryEntityUtil.convert2Map(eligibleData, e -> e.getTaxAgentId() + "-" + e.getEmployeeId()); + if (deductionPOMap.containsKey(key)) { + deductionPOMap.get(key).getFreeIncomeList().add(freeIncomePO); + } else { + po.getFreeIncomeList().add(freeIncomePO); + eligibleData.add(po); + } + + } else { + errorCount += 1; + // 添加错误数据 + } + } + + //入库 +// handleImportDetailData(eligibleData); + + apidatas.put("successCount", successCount); + apidatas.put("errorCount", errorCount); + apidatas.put("errorData", errorData); + + } finally { + IOUtils.closeQuietly(fileInputStream); + } + return apidatas; + } + /** * 处理导入数据 * @@ -464,8 +670,6 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction String imageId = Util.null2String(importParam.getImageId()); //税款所属期 String declareMonthStr = Util.null2String(importParam.getDeclareMonth()); - //个税扣缴义务人 - String taxAgentId = Util.null2String(importParam.getTaxAgentId()); if (StringUtils.isBlank(imageId)) { throw new SalaryRunTimeException("文件不存在"); @@ -510,7 +714,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction private List> getExcelRowList(OtherDeductionQueryParam param, boolean hasData) { long employeeId = user.getUID(); //excel标题 - List title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "免税收入", "减免税额", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金"); + List title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "免税收入", "商业健康保险", "税延养老保险", "准予扣除的捐赠额", "减免税额", "其他", "个人养老金"); List> rowList = new ArrayList<>(); rowList.add(title); @@ -611,7 +815,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction */ private List> getExcelRowDetailList(OtherDeductionQueryParam param) { //excel标题 - List title = Arrays.asList("姓名", "申报月份", "个税扣缴义务人", "部门", "手机号", "工号", "免税收入", "减免税额", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金"); + List title = Arrays.asList("姓名", "申报月份", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "免税收入", "商业健康保险", "税延养老保险", "准予扣除的捐赠额", "减免税额", "其他", "个人养老金"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); //查询详细信息 @@ -1044,4 +1248,29 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction return book; } + @Override + public XSSFWorkbook downloadDetailTemplate(OtherDeductionQueryParam param) { + + + Map>> map = new LinkedHashMap<>(); + + List freeIncomeTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "免税事项", "免税性质", "免税金额"); + map.put("免税收入", Arrays.asList(freeIncomeTitle)); + List healthInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "税优识别码", "保单生效日期", "年度保费", "月度保费", "本期扣除金额"); + map.put("商业健康保险", Arrays.asList(healthInsuranceTitle)); + List endowmentInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "税延养老账户编号", "报税校验码", "年度保费", "月度保费", "本期扣除金额"); + map.put("税延养老保险", Arrays.asList(endowmentInsuranceTitle)); + List grantDonationTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "受赠单位名称", "受赠单位纳税人识别号", "凭证号", "捐赠日期", "捐赠金额", "扣除比例", "实际扣除金额"); + map.put("准予扣除的捐赠额", Arrays.asList(grantDonationTitle)); + List derateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "减免事项", "减免性质", "减免金额"); + map.put("减免税额", Arrays.asList(derateDeductionTitle)); + List otherDerateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "其他免税扣除金额", "备注"); + map.put("其他", Arrays.asList(otherDerateDeductionTitle)); +// map.put("个人养老金", rowList); + + + XSSFWorkbook book = ExcelUtil.genWorkbookV2(map); + return book; + } + } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java index 9d44300cc..ade9b3e6c 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java @@ -100,6 +100,12 @@ public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDe } } + @Override + public boolean enableUse() { + TaxDeclarationApiConfigPO config = getConfig(false); + return config == null || SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse()); + } + private String getApiHost() { List apiProfiles = getTaxDeclarationApiProfileMapper().listAll(); if (apiProfiles.isEmpty() || TaxDeclareApiProfileEnum.PROD.getValue().equals(apiProfiles.get(0).getApiProfile())) { diff --git a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java index 3002e8cfd..f8a261828 100644 --- a/src/com/engine/salary/wrapper/OtherDeductionWrapper.java +++ b/src/com/engine/salary/wrapper/OtherDeductionWrapper.java @@ -14,9 +14,11 @@ import com.engine.salary.exception.SalaryRunTimeException; import com.engine.salary.service.OtherDeductionService; import com.engine.salary.service.SalaryEmployeeService; import com.engine.salary.service.TaxAgentService; +import com.engine.salary.service.TaxDeclarationApiConfigService; import com.engine.salary.service.impl.OtherDeductionServiceImpl; import com.engine.salary.service.impl.SalaryEmployeeServiceImpl; import com.engine.salary.service.impl.TaxAgentServiceImpl; +import com.engine.salary.service.impl.TaxDeclarationApiConfigServiceImpl; import com.engine.salary.util.SalaryI18nUtil; import com.engine.salary.util.page.PageInfo; import lombok.extern.slf4j.Slf4j; @@ -43,6 +45,10 @@ public class OtherDeductionWrapper extends Service { return ServiceUtil.getService(OtherDeductionServiceImpl.class, user); } + private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + private TaxAgentService getTaxAgentV2Service(User user) { return ServiceUtil.getService(TaxAgentServiceImpl.class, user); } @@ -196,7 +202,15 @@ public class OtherDeductionWrapper extends Service { * @return */ public XSSFWorkbook downloadTemplate(OtherDeductionQueryParam queryParam) { - return getOtherDeductionService(user).downloadTemplate(queryParam); + + //是否开启了智能算薪 + boolean enableUse = getTaxDeclarationApiConfigService(user).enableUse(); + + if(enableUse){ + return getOtherDeductionService(user).downloadDetailTemplate(queryParam); + }else { + return getOtherDeductionService(user).downloadTemplate(queryParam); + } } /** @@ -210,7 +224,14 @@ public class OtherDeductionWrapper extends Service { * 导入数据 */ public Map importData(OtherDeductionImportParam importParam) { - return getOtherDeductionService(user).importData(importParam); + //是否开启了智能算薪 + boolean enableUse = getTaxDeclarationApiConfigService(user).enableUse(); + + if(enableUse){ + return getOtherDeductionService(user).importDetailData(importParam); + }else { + return getOtherDeductionService(user).importData(importParam); + } } /**