Merge branch 'release/个税&业务线' into custom/钱智

This commit is contained in:
钱涛 2025-07-03 09:09:35 +08:00
commit 4fd9883858
58 changed files with 936 additions and 62 deletions

View File

@ -1,5 +1,5 @@
log=false
defaultCloseNonStandard149=true
AESEncryptScrect=990EB004A1C862721C1513AE90038C9E
version=3.0.2.2504.03
version=3.0.2.2504.04
openFormulaForcedEditing=false

View File

@ -0,0 +1,21 @@
ALTER TABLE hrsa_free_income ADD income_category int;
/
ALTER TABLE hrsa_derate_deduction ADD income_category int;
/
ALTER TABLE hrsa_endowment_insurance ADD income_category int;
/
ALTER TABLE hrsa_grant_donation ADD income_category int;
/
ALTER TABLE hrsa_health_insurance ADD income_category int;
/
ALTER TABLE hrsa_other_derate_deduction ADD income_category int;
/
ALTER TABLE hrsa_personal_pension ADD income_category int;
/

View File

@ -0,0 +1,21 @@
update hrsa_free_income set income_category = 1;
/
update hrsa_derate_deduction set income_category = 1;
/
update hrsa_endowment_insurance set income_category = 1;
/
update hrsa_grant_donation set income_category = 1;
/
update hrsa_health_insurance set income_category = 1;
/
update hrsa_other_derate_deduction set income_category = 1;
/
update hrsa_personal_pension set income_category = 1;
/

View File

@ -0,0 +1,21 @@
ALTER TABLE hrsa_free_income ADD income_category int;
/
ALTER TABLE hrsa_derate_deduction ADD income_category int;
/
ALTER TABLE hrsa_endowment_insurance ADD income_category int;
/
ALTER TABLE hrsa_grant_donation ADD income_category int;
/
ALTER TABLE hrsa_health_insurance ADD income_category int;
/
ALTER TABLE hrsa_other_derate_deduction ADD income_category int;
/
ALTER TABLE hrsa_personal_pension ADD income_category int;
/

View File

@ -0,0 +1,21 @@
update hrsa_free_income set income_category = 1;
/
update hrsa_derate_deduction set income_category = 1;
/
update hrsa_endowment_insurance set income_category = 1;
/
update hrsa_grant_donation set income_category = 1;
/
update hrsa_health_insurance set income_category = 1;
/
update hrsa_other_derate_deduction set income_category = 1;
/
update hrsa_personal_pension set income_category = 1;
/

View File

@ -0,0 +1,21 @@
ALTER TABLE hrsa_free_income ADD income_category int;
/
ALTER TABLE hrsa_derate_deduction ADD income_category int;
/
ALTER TABLE hrsa_endowment_insurance ADD income_category int;
/
ALTER TABLE hrsa_grant_donation ADD income_category int;
/
ALTER TABLE hrsa_health_insurance ADD income_category int;
/
ALTER TABLE hrsa_other_derate_deduction ADD income_category int;
/
ALTER TABLE hrsa_personal_pension ADD income_category int;
/

View File

@ -0,0 +1,21 @@
update hrsa_free_income set income_category = 1;
/
update hrsa_derate_deduction set income_category = 1;
/
update hrsa_endowment_insurance set income_category = 1;
/
update hrsa_grant_donation set income_category = 1;
/
update hrsa_health_insurance set income_category = 1;
/
update hrsa_other_derate_deduction set income_category = 1;
/
update hrsa_personal_pension set income_category = 1;
/

View File

@ -0,0 +1,7 @@
ALTER TABLE hrsa_free_income ADD COLUMN income_category int(0);
ALTER TABLE hrsa_derate_deduction ADD COLUMN income_category int(0);
ALTER TABLE hrsa_endowment_insurance ADD COLUMN income_category int(0);
ALTER TABLE hrsa_grant_donation ADD COLUMN income_category int(0);
ALTER TABLE hrsa_health_insurance ADD COLUMN income_category int(0);
ALTER TABLE hrsa_other_derate_deduction ADD COLUMN income_category int(0);
ALTER TABLE hrsa_personal_pension ADD COLUMN income_category int(0);

View File

@ -0,0 +1,7 @@
update hrsa_free_income set income_category = 1;
update hrsa_derate_deduction set income_category = 1;
update hrsa_endowment_insurance set income_category = 1;
update hrsa_grant_donation set income_category = 1;
update hrsa_health_insurance set income_category = 1;
update hrsa_other_derate_deduction set income_category = 1;
update hrsa_personal_pension set income_category = 1;

View File

@ -0,0 +1,20 @@
ALTER TABLE hrsa_free_income ADD income_category int
/
ALTER TABLE hrsa_derate_deduction ADD income_category int
/
ALTER TABLE hrsa_endowment_insurance ADD income_category int
/
ALTER TABLE hrsa_grant_donation ADD income_category int
/
ALTER TABLE hrsa_health_insurance ADD income_category int
/
ALTER TABLE hrsa_other_derate_deduction ADD income_category int
/
ALTER TABLE hrsa_personal_pension ADD income_category int
/

View File

@ -0,0 +1,14 @@
update hrsa_free_income set income_category = 1
/
update hrsa_derate_deduction set income_category = 1
/
update hrsa_endowment_insurance set income_category = 1
/
update hrsa_grant_donation set income_category = 1
/
update hrsa_health_insurance set income_category = 1
/
update hrsa_other_derate_deduction set income_category = 1
/
update hrsa_personal_pension set income_category = 1
/

View File

@ -0,0 +1,20 @@
ALTER TABLE hrsa_free_income ADD income_category int;
/
ALTER TABLE hrsa_derate_deduction ADD income_category int;
/
ALTER TABLE hrsa_endowment_insurance ADD income_category int;
/
ALTER TABLE hrsa_grant_donation ADD income_category int;
/
ALTER TABLE hrsa_health_insurance ADD income_category int;
/
ALTER TABLE hrsa_other_derate_deduction ADD income_category int;
/
ALTER TABLE hrsa_personal_pension ADD income_category int;
/

View File

@ -0,0 +1,20 @@
update hrsa_free_income set income_category = 1;
/
update hrsa_derate_deduction set income_category = 1;
/
update hrsa_endowment_insurance set income_category = 1;
/
update hrsa_grant_donation set income_category = 1;
/
update hrsa_health_insurance set income_category = 1;
/
update hrsa_other_derate_deduction set income_category = 1;
/
update hrsa_personal_pension set income_category = 1;
/

View File

@ -0,0 +1,20 @@
ALTER TABLE hrsa_free_income ADD income_category int
GO
ALTER TABLE hrsa_derate_deduction ADD income_category int
GO
ALTER TABLE hrsa_endowment_insurance ADD income_category int
GO
ALTER TABLE hrsa_grant_donation ADD income_category int
GO
ALTER TABLE hrsa_health_insurance ADD income_category int
GO
ALTER TABLE hrsa_other_derate_deduction ADD income_category int
GO
ALTER TABLE hrsa_personal_pension ADD income_category int
GO

View File

@ -0,0 +1,14 @@
update hrsa_free_income set income_category = 1
GO
update hrsa_derate_deduction set income_category = 1
GO
update hrsa_endowment_insurance set income_category = 1
GO
update hrsa_grant_donation set income_category = 1
GO
update hrsa_health_insurance set income_category = 1
GO
update hrsa_other_derate_deduction set income_category = 1
GO
update hrsa_personal_pension set income_category = 1
GO

View File

@ -0,0 +1,21 @@
ALTER TABLE hrsa_free_income ADD income_category int;
/
ALTER TABLE hrsa_derate_deduction ADD income_category int;
/
ALTER TABLE hrsa_endowment_insurance ADD income_category int;
/
ALTER TABLE hrsa_grant_donation ADD income_category int;
/
ALTER TABLE hrsa_health_insurance ADD income_category int;
/
ALTER TABLE hrsa_other_derate_deduction ADD income_category int;
/
ALTER TABLE hrsa_personal_pension ADD income_category int;
/

View File

@ -0,0 +1,21 @@
update hrsa_free_income set income_category = 1;
/
update hrsa_derate_deduction set income_category = 1;
/
update hrsa_endowment_insurance set income_category = 1;
/
update hrsa_grant_donation set income_category = 1;
/
update hrsa_health_insurance set income_category = 1;
/
update hrsa_other_derate_deduction set income_category = 1;
/
update hrsa_personal_pension set income_category = 1;
/

View File

@ -82,17 +82,22 @@ public class DerateDeductionListDTO {
@TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo")
private String idNo;
@ExcelProperty(index = 6)
@TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName")
private String incomeCategoryName;
private Integer incomeCategory;
@ExcelProperty(index = 7)
@TableTitle(title = "减免事项", dataIndex = "derateItem", key = "derateItem")
private String derateItem;
@ExcelProperty(index = 7)
@ExcelProperty(index = 8)
@TableTitle(title = "减免性质", dataIndex = "derateProperty", key = "derateProperty")
@ElogTransform(name = "减免性质")
private String derateProperty;
@ExcelProperty(index = 8)
@ExcelProperty(index = 9)
@TableTitle(title = "减免金额", dataIndex = "derateAmount", key = "derateAmount")
@ElogTransform(name = "减免金额")
private String derateAmount;

View File

@ -82,27 +82,32 @@ public class EndowmentInsuranceListDTO {
private String idNo;
@ExcelProperty(index = 6)
@TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName")
private String incomeCategoryName;
private Integer incomeCategory;
@ExcelProperty(index = 7)
@TableTitle(title = "申报扣除月份", dataIndex = "deductionMonth", key = "deductionMonth")
@JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
private Date deductionMonth;
@ExcelProperty(index = 7)
@ExcelProperty(index = 8)
@TableTitle(title = "税延养老账户编号", dataIndex = "accountNumber", key = "accountNumber")
private String accountNumber;
@ExcelProperty(index = 8)
@ExcelProperty(index = 9)
@TableTitle(title = "报税校验码", dataIndex = "checkCode", key = "checkCode")
private String checkCode;
@ExcelProperty(index = 9)
@ExcelProperty(index = 10)
@TableTitle(title = "年度保费", dataIndex = "yearPremium", key = "yearPremium")
private String yearPremium;
@ExcelProperty(index = 10)
@ExcelProperty(index = 11)
@TableTitle(title = "月度保费", dataIndex = "monthPremium", key = "monthPremium")
private String monthPremium;
@ExcelProperty(index = 11)
@ExcelProperty(index = 12)
@TableTitle(title = "本期扣除金额", dataIndex = "currentDeduction", key = "currentDeduction")
private String currentDeduction;

View File

@ -84,14 +84,19 @@ public class FreeIncomeListDTO {
@ExcelProperty(index = 6)
@TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName")
private String incomeCategoryName;
private Integer incomeCategory;
@ExcelProperty(index = 7)
@TableTitle(title = "免税事项", dataIndex = "freeItem", key = "freeItem")
private String freeItem;
@ExcelProperty(index = 7)
@ExcelProperty(index = 8)
@TableTitle(title = "免税性质", dataIndex = "freeProperty", key = "freeProperty")
private String freeProperty;
@ExcelProperty(index = 8)
@ExcelProperty(index = 9)
@TableTitle(title = "免税金额", dataIndex = "freeAmount", key = "freeAmount")
@Encrypt
private String freeAmount;

View File

@ -88,33 +88,38 @@ public class GrantDonationListDTO {
@ExcelProperty(index = 5)
private String idNo;
@ExcelProperty(index = 6)
@TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName")
private String incomeCategoryName;
private Integer incomeCategory;
@ExcelProperty(index = 7)
@TableTitle(title = "受赠单位名称", dataIndex = "recipientName", key = "recipientName")
private String recipientName;
@ExcelProperty(index = 7)
@ExcelProperty(index = 8)
@TableTitle(title = "受赠单位纳税人识别号", dataIndex = "taxCode", key = "taxCode")
private String taxCode;
@ExcelProperty(index = 8)
@ExcelProperty(index = 9)
@TableTitle(title = "捐赠凭证号", dataIndex = "donationNumber", key = "donationNumber")
private String donationNumber;
@ExcelProperty(index = 9)
@ExcelProperty(index = 10)
@TableTitle(title = "捐赠日期", dataIndex = "donateDate", key = "donateDate")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date donateDate;
@ExcelProperty(index = 10)
@ExcelProperty(index = 11)
@TableTitle(title = "捐赠金额", dataIndex = "donateAmount", key = "donateAmount")
private String donateAmount;
@ExcelProperty(index = 11)
@ExcelProperty(index = 12)
@TableTitle(title = "扣除比例", dataIndex = "deductionProportion", key = "deductionProportion")
private String deductionProportion;
@ExcelProperty(index = 12)
@ExcelProperty(index = 13)
@TableTitle(title = "实际扣除金额", dataIndex = "actualDeduction", key = "actualDeduction")
private String actualDeduction;

View File

@ -85,23 +85,28 @@ public class HealthInsuranceListDTO {
private String idNo;
@ExcelProperty(index = 6)
@TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName")
private String incomeCategoryName;
private Integer incomeCategory;
@ExcelProperty(index = 7)
@TableTitle(title = "税优识别码", dataIndex = "identificationNumber", key = "identificationNumber")
private String identificationNumber;
@ExcelProperty(index = 7)
@ExcelProperty(index = 8)
@TableTitle(title = "保单生效日期", dataIndex = "effectiveDate", key = "effectiveDate")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date effectiveDate;
@ExcelProperty(index = 8)
@ExcelProperty(index = 9)
@TableTitle(title = "年度保费", dataIndex = "yearPremium", key = "yearPremium")
private String yearPremium;
@ExcelProperty(index = 9)
@ExcelProperty(index = 10)
@TableTitle(title = "月度保费", dataIndex = "monthPremium", key = "monthPremium")
private String monthPremium;
@ExcelProperty(index = 10)
@ExcelProperty(index = 11)
@TableTitle(title = "本期扣除金额", dataIndex = "currentDeduction", key = "currentDeduction")
private String currentDeduction;

View File

@ -85,10 +85,15 @@ public class OtherDerateDeductionListDTO {
private String idNo;
@ExcelProperty(index = 6)
@TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName")
private String incomeCategoryName;
private Integer incomeCategory;
@ExcelProperty(index = 7)
@TableTitle(title = "减免税额", dataIndex = "otherDeduction", key = "otherDeduction")
private String otherDeduction;
@ExcelProperty(index = 7)
@ExcelProperty(index = 8)
@TableTitle(title = "备注", dataIndex = "remark", key = "remark")
private String remark;

View File

@ -83,6 +83,11 @@ public class PersonalPensionListDTO {
@TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo")
private String idNo;
@ExcelProperty(index = 6)
@TableTitle(title = "所得项目", dataIndex = "incomeCategoryName", key = "incomeCategoryName")
private String incomeCategoryName;
private Integer incomeCategory;
//缴费月度
private Date payMonth;
@ -91,17 +96,17 @@ public class PersonalPensionListDTO {
private Integer voucherType;
//凭证类别名称
@ExcelProperty(index = 6)
@ExcelProperty(index = 7)
@TableTitle(title = "凭证类型", dataIndex = "voucherTypeName", key = "voucherTypeName")
private String voucherTypeName;
//凭证编码
@ExcelProperty(index = 7)
@ExcelProperty(index = 8)
@TableTitle(title = "凭证编码", dataIndex = "voucherNo", key = "voucherNo")
private String voucherNo;
//缴费金额
@ExcelProperty(index = 8)
@ExcelProperty(index = 9)
@TableTitle(title = "缴费金额", dataIndex = "payAmount", key = "payAmount")
private String payAmount;

View File

@ -1,5 +1,6 @@
package com.engine.salary.entity.datacollection.param;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -26,6 +27,12 @@ public class DerateDeductionSaveParam {
//主表数据Id
private Long mainId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
//减免事项
private String derateItem;

View File

@ -1,5 +1,6 @@
package com.engine.salary.entity.datacollection.param;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -30,6 +31,12 @@ public class EndowmentInsuranceSaveParam {
//主表数据Id
private Long mainId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
//申报扣除月份
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")

View File

@ -1,5 +1,6 @@
package com.engine.salary.entity.datacollection.param;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -26,6 +27,11 @@ public class FreeIncomeSaveParam {
//主表数据Id
private Long mainId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
//免税事项
private String freeItem;

View File

@ -1,5 +1,6 @@
package com.engine.salary.entity.datacollection.param;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -26,6 +27,12 @@ public class GrantDonationSaveParam {
//主表数据Id
private Long mainId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
//受赠单位名称
private String recipientName;

View File

@ -1,5 +1,6 @@
package com.engine.salary.entity.datacollection.param;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -28,6 +29,12 @@ public class HealthInsuranceSaveParam {
//主表数据Id
private Long mainId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
//税优识别码
private String identificationNumber;

View File

@ -1,5 +1,6 @@
package com.engine.salary.entity.datacollection.param;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -26,6 +27,12 @@ public class OtherDerateDeductionSaveParam {
//主表数据Id
private Long mainId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
//减免税额
private String otherDeduction;

View File

@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.param;
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import com.engine.salary.enums.datacollection.EnumDeductionDataSource;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -31,6 +32,12 @@ public class PersonalPensionSaveParam {
//主表数据Id
private Long mainId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
//缴费月度
private Date payMonth;

View File

@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po;
import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -42,6 +43,12 @@ public class DerateDeductionPO{
@ElogTransform(name = "个税扣缴义务人")
private Long taxAgentId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
@ElogTransform(name = "减免事项")
private String derateItem;

View File

@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po;
import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -41,6 +42,12 @@ public class EndowmentInsurancePO {
@ElogTransform(name = "个税扣缴义务人ID")
private Long taxAgentId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
@ElogTransform(name = "申报扣除月份")
private Date deductionMonth;

View File

@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po;
import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -52,6 +53,12 @@ public class FreeIncomePO {
@ElogTransform(name = "归档状态 0未归档 1已归档")
private Integer fileStatus;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
/**
* 人员类型
*

View File

@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po;
import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -38,6 +39,12 @@ public class GrantDonationPO {
@ElogTransform(name = "个税扣缴义务人")
private Long taxAgentId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
@ElogTransform(name = "受赠单位名称")
private String recipientName;

View File

@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po;
import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -40,6 +41,12 @@ public class HealthInsurancePO {
@ElogTransform(name = "个税扣缴义务人")
private Long taxAgentId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
@ElogTransform(name = "税优识别码")
private String identificationNumber;

View File

@ -138,6 +138,7 @@ public class OtherDeductionPO {
private List<Long> employeeIds;
private Collection<Long> taxAgentIds;
private Integer incomeCategory;
private List<FreeIncomePO> freeIncomeList;

View File

@ -2,6 +2,7 @@ package com.engine.salary.entity.datacollection.po;
import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -40,6 +41,12 @@ public class OtherDerateDeductionPO {
@ElogTransform(name = "个税扣缴义务人")
private Long taxAgentId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
@ElogTransform(name = "减免税额")
private String otherDeduction;

View File

@ -3,6 +3,7 @@ package com.engine.salary.entity.datacollection.po;
import com.engine.hrmelog.annotation.ElogTransform;
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import com.engine.salary.enums.datacollection.EnumDeductionDataSource;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -45,6 +46,12 @@ public class PersonalPensionPO{
@ElogTransform(name = "个税扣缴义务人")
private Long taxAgentId;
/**
* 所得项目
* @see IncomeCategoryEnum
*/
private Integer incomeCategory;
@ElogTransform(name = "凭证类别")
private Integer voucherType;

View File

@ -850,7 +850,7 @@ public class SalaryBillBO {
if ("text".equals(wmClassify)) {
wmTextFieldIds = (List<String>) salaryBillWatermark.getWmSetting().getOrDefault("wmSelectedFieldIds", Collections.emptyList());
List<String> empFields = Arrays.asList(HRM_Name, HRM_Num, HRM_Mobile, HRM_Email, HRM_CurrentOperatorId, HRM_Department);
List<String> empFields = Arrays.asList(HRM_Name, HRM_Num, HRM_Mobile, HRM_Email, HRM_CurrentOperatorId, HRM_Department, HRM_SecondDepartment);
if (wmTextFieldIds.contains(HRM_SecondDepartment)) {
// 需要查分部
salaryBillWatermark.getWmSetting().put("needQuerySubDepart", true);

View File

@ -21,6 +21,7 @@ import weaver.general.Util;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
/**
* 个税申报
@ -151,7 +152,8 @@ public class TaxDeclarationRequest {
Map<String, ? extends List> freeIncomeMap = taxFreeMap.get(TaxFreeTypeEnum.FREE_INCOME);
List<FreeIncomePO> poList = (List<FreeIncomePO>) freeIncomeMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle()));
if (CollectionUtils.isNotEmpty(poList)) {
List<Map<String, Object>> paramMaps = new ArrayList<>();
poList = poList.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList());
List<Map<String, Object>> paramMaps = listRequestParam.getOrDefault("msfblb",new ArrayList<>());
for (FreeIncomePO po : poList) {
Map<String, Object> map = new HashMap<>();
// 姓名
@ -176,7 +178,8 @@ public class TaxDeclarationRequest {
Map<String, ? extends List> healthInsuranceMap = taxFreeMap.get(TaxFreeTypeEnum.HEALTH_INSURANCE);
List<HealthInsurancePO> pos = (List<HealthInsurancePO>) healthInsuranceMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle()));
if (CollectionUtils.isNotEmpty(pos)) {
List<Map<String, Object>> paramMaps = new ArrayList<>();
pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList());
List<Map<String, Object>> paramMaps = listRequestParam.getOrDefault("syjkbxfblb",new ArrayList<>());
for (HealthInsurancePO healthInsurancePO : pos) {
Map<String, Object> map = new HashMap<>();
// 姓名
@ -203,7 +206,8 @@ public class TaxDeclarationRequest {
Map<String, ? extends List> posMap = taxFreeMap.get(TaxFreeTypeEnum.ENDOWMENT_INSURANCE);
List<EndowmentInsurancePO> pos = (List<EndowmentInsurancePO>) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle()));
if (CollectionUtils.isNotEmpty(pos)) {
List<Map<String, Object>> paramMaps = new ArrayList<>();
pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList());
List<Map<String, Object>> paramMaps = listRequestParam.getOrDefault("syylbxfblb",new ArrayList<>());
for (EndowmentInsurancePO po : pos) {
Map<String, Object> map = new HashMap<>();
// 姓名
@ -222,7 +226,7 @@ public class TaxDeclarationRequest {
map.put("sjkcje", po.getCurrentDeduction());
paramMaps.add(map);
}
listRequestParam.put("syjkbxfblb", paramMaps);
listRequestParam.put("syylbxfblb", paramMaps);
}
}
@ -231,7 +235,8 @@ public class TaxDeclarationRequest {
Map<String, ? extends List> posMap = taxFreeMap.get(TaxFreeTypeEnum.GRANT_DONATION);
List<GrantDonationPO> pos = (List<GrantDonationPO>) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle()));
if (CollectionUtils.isNotEmpty(pos)) {
List<Map<String, Object>> paramMaps = new ArrayList<>();
pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList());
List<Map<String, Object>> paramMaps = listRequestParam.getOrDefault("zykcjzefb",new ArrayList<>());
for (GrantDonationPO po : pos) {
Map<String, Object> map = new HashMap<>();
// 姓名
@ -262,7 +267,8 @@ public class TaxDeclarationRequest {
Map<String, ? extends List> posMap = taxFreeMap.get(TaxFreeTypeEnum.DERATE_DEDUCTION);
List<DerateDeductionPO> pos = (List<DerateDeductionPO>) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle()));
if (CollectionUtils.isNotEmpty(pos)) {
List<Map<String, Object>> paramMaps = new ArrayList<>();
pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList());
List<Map<String, Object>> paramMaps = listRequestParam.getOrDefault("jmfblb",new ArrayList<>());
for (DerateDeductionPO po : pos) {
Map<String, Object> map = new HashMap<>();
// 姓名
@ -287,6 +293,7 @@ public class TaxDeclarationRequest {
Map<String, ? extends List> posMap = taxFreeMap.get(TaxFreeTypeEnum.OTHER_DERATE_DEDUCTION);
List<OtherDerateDeductionPO> pos = (List<OtherDerateDeductionPO>) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle()));
if (CollectionUtils.isNotEmpty(pos)) {
pos = pos.stream().filter(po -> Objects.equals(po.getIncomeCategory(), incomeCategoryEnum.getValue())).collect(Collectors.toList());
employeeRequestParam.put("bz", pos.get(0).getRemark());
}
}
@ -322,9 +329,10 @@ public class TaxDeclarationRequest {
public static Map<String, Object> convert2flsdRequestParam(List<TaxReportColumnPO> taxReportColumns,
List<TaxDeclarationPO> taxDeclarations,
List<TaxDeclarationValuePO> taxDeclarationValues,
List<EmployeeDeclarePO> employeeDeclares) {
List<TaxDeclarationPO> taxDeclarations,
List<TaxDeclarationValuePO> taxDeclarationValues,
List<EmployeeDeclarePO> employeeDeclares,
Map<TaxFreeTypeEnum, Map<String, ? extends List>> taxFreeMap) {
Map<String, Map<String, Object>> objRequestParam = Maps.newHashMap();
Map<String, List<Map<String, Object>>> listRequestParam = Maps.newHashMap();
Map<String, List<TaxReportColumnPO>> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory);
@ -332,9 +340,9 @@ public class TaxDeclarationRequest {
Map<Long, List<TaxDeclarationValuePO>> taxDeclarationValueMap = SalaryEntityUtil.group2Map(taxDeclarationValues, TaxDeclarationValuePO::getTaxDeclarationId);
for (TaxDeclarationPO taxDeclaration : taxDeclarations) {
List<TaxDeclarationValuePO> values = taxDeclarationValueMap.get(taxDeclaration.getId());
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory());
for (TaxDeclarationValuePO taxDeclarationValue : values) {
EmployeeDeclarePO employeeDeclare = employeeDeclareMap.get(taxDeclarationValue.getEmployeeId());
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory());
if (employeeDeclare == null || incomeCategoryEnum == null) {
continue;
}
@ -350,6 +358,8 @@ public class TaxDeclarationRequest {
List<Map<String, Object>> employeeRequestParams = listRequestParam.computeIfAbsent("lxgxhllb", k -> Lists.newArrayList());
employeeRequestParams.add(employeeRequestParam);
}
// 其他免税扣除附表
buildOtherDeductionDetailParams(taxFreeMap, listRequestParam, employeeDeclare, incomeCategoryEnum, employeeRequestParam);
}
}
@ -363,7 +373,8 @@ public class TaxDeclarationRequest {
public static Map<String, Object> convert2fjmsdRequestParam(List<TaxReportColumnPO> taxReportColumns,
List<TaxDeclarationPO> taxDeclarations,
List<TaxDeclarationValuePO> taxDeclarationValues,
List<EmployeeDeclarePO> employeeDeclares) {
List<EmployeeDeclarePO> employeeDeclares,
Map<TaxFreeTypeEnum, Map<String, ? extends List>> taxFreeMap) {
Map<String, Map<String, Object>> objRequestParam = Maps.newHashMap();
Map<String, List<Map<String, Object>>> listRequestParam = Maps.newHashMap();
Map<String, List<TaxReportColumnPO>> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory);

View File

@ -800,8 +800,8 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
}
private static void checkSSSBYYLBResponse(List<GetASynIndividualIncomeTaxFeedbackResponse.Body.sssbyy> sssbyylb) {
if(CollUtil.isNotEmpty(sssbyylb)){
String err = sssbyylb.stream().map(sssbyy -> sssbyy.getXm() + sssbyy.getCwxx()).collect(Collectors.joining(","));
if (CollUtil.isNotEmpty(sssbyylb)) {
String err = sssbyylb.stream().map(sssbyy -> sssbyy.getXm() + sssbyy.getCwxx()).collect(Collectors.joining(","));
throw new OnlineCalculateTaxException(err);
}
}
@ -852,6 +852,15 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
return null;
}
public static IncomeCategoryEnum parseByDefaultLabel(String defaultLabel) {
for (IncomeCategoryEnum incomeCategoryEnum : IncomeCategoryEnum.values()) {
if (incomeCategoryEnum.getDefaultLabel().equals(defaultLabel)) {
return incomeCategoryEnum;
}
}
return null;
}
public static List<IncomeCategoryEnum> parseByValue(Collection<Integer> values) {
if (CollectionUtils.isEmpty(values)) {
return Collections.emptyList();

View File

@ -17,6 +17,7 @@
<result column="tax_year_month" property="taxYearMonth"/>
<result column="tenant_key" property="tenantKey"/>
<result column="update_time" property="updateTime"/>
<result column="income_category" property="incomeCategory"/>
</resultMap>
<!-- 表字段 -->
@ -38,6 +39,7 @@
, t.tax_year_month
, t.tenant_key
, t.update_time
, t.income_category
</sql>
<!-- 查询全部 -->
@ -108,6 +110,9 @@
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="incomeCategory != null">
AND income_category = #{incomeCategory}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
@ -168,6 +173,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="incomeCategory != null">
income_category,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="createTime != null">
@ -215,6 +223,9 @@
<if test="updateTime != null">
#{updateTime},
</if>
<if test="incomeCategory != null">
#{incomeCategory},
</if>
</trim>
</insert>
@ -237,6 +248,7 @@
tax_year_month=#{taxYearMonth},
tenant_key=#{tenantKey},
update_time=#{updateTime},
income_category=#{incomeCategory},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -288,6 +300,9 @@
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="incomeCategory != null">
income_category=#{incomeCategory},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

@ -20,6 +20,7 @@
<result column="tenant_key" property="tenantKey"/>
<result column="update_time" property="updateTime"/>
<result column="year_premium" property="yearPremium"/>
<result column="income_category" property="incomeCategory"/>
</resultMap>
<!-- 表字段 -->
@ -44,6 +45,7 @@
, t.tenant_key
, t.update_time
, t.year_premium
, t.income_category
</sql>
<!-- 查询全部 -->
@ -123,6 +125,9 @@
<if test="yearPremium != null">
AND year_premium = #{yearPremium}
</if>
<if test="incomeCategory != null">
AND income_category = #{incomeCategory}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
@ -192,6 +197,9 @@
<if test="yearPremium != null">
year_premium,
</if>
<if test="incomeCategory != null">
income_category,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="accountNumber != null">
@ -248,6 +256,9 @@
<if test="yearPremium != null">
#{yearPremium},
</if>
<if test="incomeCategory != null">
#{incomeCategory},
</if>
</trim>
</insert>
@ -273,6 +284,7 @@
tenant_key=#{tenantKey},
update_time=#{updateTime},
year_premium=#{yearPremium},
income_category=#{incomeCategory},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -333,6 +345,9 @@
<if test="yearPremium != null">
year_premium=#{yearPremium},
</if>
<if test="incomeCategory != null">
income_category=#{incomeCategory},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

@ -17,6 +17,7 @@
<result column="tax_year_month" property="taxYearMonth"/>
<result column="tenant_key" property="tenantKey"/>
<result column="update_time" property="updateTime"/>
<result column="income_category" property="incomeCategory"/>
</resultMap>
<!-- 表字段 -->
@ -38,6 +39,7 @@
, t.tax_year_month
, t.tenant_key
, t.update_time
, t.income_category
</sql>
<!-- 查询全部 -->
@ -108,6 +110,9 @@
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="incomeCategory != null">
AND income_category = #{incomeCategory}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
@ -168,6 +173,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="incomeCategory != null">
income_category,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="createTime != null">
@ -215,6 +223,9 @@
<if test="updateTime != null">
#{updateTime},
</if>
<if test="incomeCategory != null">
#{incomeCategory},
</if>
</trim>
</insert>
@ -237,6 +248,7 @@
tax_year_month=#{taxYearMonth},
tenant_key=#{tenantKey},
update_time=#{updateTime},
income_category=#{incomeCategory},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -288,6 +300,9 @@
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="incomeCategory != null">
income_category=#{incomeCategory},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

@ -21,6 +21,7 @@
<result column="tax_year_month" property="taxYearMonth"/>
<result column="tenant_key" property="tenantKey"/>
<result column="update_time" property="updateTime"/>
<result column="income_category" property="incomeCategory"/>
</resultMap>
<!-- 表字段 -->
@ -46,6 +47,7 @@
, t.tax_year_month
, t.tenant_key
, t.update_time
, t.income_category
</sql>
<!-- 查询全部 -->
@ -128,6 +130,9 @@
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="incomeCategory != null">
AND income_category = #{incomeCategory}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
@ -200,6 +205,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="incomeCategory != null">
income_category,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="actualDeduction != null">
@ -259,6 +267,9 @@
<if test="updateTime != null">
#{updateTime},
</if>
<if test="incomeCategory != null">
#{incomeCategory},
</if>
</trim>
</insert>
@ -285,6 +296,7 @@
tax_year_month=#{taxYearMonth},
tenant_key=#{tenantKey},
update_time=#{updateTime},
income_category=#{incomeCategory},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -348,6 +360,9 @@
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="incomeCategory != null">
income_category=#{incomeCategory},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

@ -19,6 +19,7 @@
<result column="tenant_key" property="tenantKey"/>
<result column="update_time" property="updateTime"/>
<result column="year_premium" property="yearPremium"/>
<result column="income_category" property="incomeCategory"/>
</resultMap>
<!-- 表字段 -->
@ -42,6 +43,7 @@
, t.tenant_key
, t.update_time
, t.year_premium
, t.income_category
</sql>
<!-- 查询全部 -->
@ -118,6 +120,9 @@
<if test="yearPremium != null">
AND year_premium = #{yearPremium}
</if>
<if test="incomeCategory != null">
AND income_category = #{incomeCategory}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
@ -184,6 +189,9 @@
<if test="yearPremium != null">
year_premium,
</if>
<if test="incomeCategory != null">
income_category,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="createTime != null">
@ -237,6 +245,9 @@
<if test="yearPremium != null">
#{yearPremium},
</if>
<if test="incomeCategory != null">
#{incomeCategory},
</if>
</trim>
</insert>
@ -261,6 +272,7 @@
tenant_key=#{tenantKey},
update_time=#{updateTime},
year_premium=#{yearPremium},
income_category=#{incomeCategory},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -318,6 +330,9 @@
<if test="yearPremium != null">
year_premium=#{yearPremium},
</if>
<if test="incomeCategory != null">
income_category=#{incomeCategory},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

@ -72,4 +72,6 @@ public interface OtherDeductionMapper {
int delete(OtherDeductionPO otherDeduction);
OtherDeductionPO getByTaxAgentIdAndEmployeeIdAndDeclareMonth(@Param("taxAgentId") Long taxAgentId, @Param("employeeId") Long employeeId, @Param("declareMonth") Date declareMonth);
List<OtherDeductionPO> listDetails(@Param("param") OtherDeductionPO param);
}

View File

@ -732,5 +732,103 @@
</trim>
</insert>
<resultMap id="listDetailsResultMap" type="com.engine.salary.entity.datacollection.po.OtherDeductionPO">
<result column="id" property="id"/>
<result column="employee_id" property="employeeId"/>
<result column="tax_agent_id" property="taxAgentId"/>
<result column="declare_month" property="declareMonth"/>
<result column="business_healthy_insurance" property="businessHealthyInsurance"/>
<result column="tax_delay_endowment_insurance" property="taxDelayEndowmentInsurance"/>
<result column="other_deduction" property="otherDeduction"/>
<result column="deduction_allowed_donation" property="deductionAllowedDonation"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="creator" property="creator"/>
<result column="delete_type" property="deleteType"/>
<result column="tenant_key" property="tenantKey"/>
<result column="private_pension" property="privatePension"/>
<result column="free_income" property="freeIncome"/>
<result column="derate_deduction" property="derateDeduction"/>
<collection property="freeIncomeList" ofType="com.engine.salary.entity.datacollection.po.FreeIncomePO">
<id property="id" column="free_id"/>
<result property="freeAmount" column="free_amount"></result>
</collection>
<collection property="derateDeductionList" ofType="com.engine.salary.entity.datacollection.po.DerateDeductionPO">
<id property="id" column="derate_id"/>
<result property="derateAmount" column="derate_amount"></result>
</collection>
<collection property="endowmentInsuranceList" ofType="com.engine.salary.entity.datacollection.po.EndowmentInsurancePO">
<id property="id" column="endowment_id"/>
<result property="currentDeduction" column="endowment_current_deduction"></result>
</collection>
<collection property="grantDonationList" ofType="com.engine.salary.entity.datacollection.po.GrantDonationPO">
<id property="id" column="grant_id"/>
<result property="actualDeduction" column="actual_deduction"></result>
</collection>
<collection property="healthInsuranceList" ofType="com.engine.salary.entity.datacollection.po.HealthInsurancePO">
<id property="id" column="health_id"/>
<result property="currentDeduction" column="health_current_deduction"></result>
</collection>
<collection property="otherDerateDeductionList" ofType="com.engine.salary.entity.datacollection.po.OtherDerateDeductionPO">
<id property="id" column="other_id"/>
<result property="otherDeduction" column="other_deduction"></result>
</collection>
<collection property="personalPensionList" ofType="com.engine.salary.entity.datacollection.po.PersonalPensionPO">
<id property="id" column="personal_id"/>
<result property="payAmount" column="pay_amount"></result>
</collection>
</resultMap>
<select id="listDetails" resultMap="listDetailsResultMap">
SELECT t.id
, t.employee_id
, t.tax_agent_id
, t.declare_month
, t.business_healthy_insurance
, t.tax_delay_endowment_insurance
, t.other_deduction
, t.deduction_allowed_donation
, t.create_time
, t.update_time
, t.creator
, t.delete_type
, t.tenant_key
, t.private_pension
, t.free_income
, t.derate_deduction
,a.id as free_id, a.free_amount
,b.id as derate_id, b.derate_amount
,c.id as endowment_id, c.current_deduction as endowment_current_deduction
,d.id as grant_id, d.actual_deduction
,e.id as health_id, e.current_deduction as health_current_deduction
,f.id as other_id, f.other_deduction
,g.id as personal_id, g.pay_amount
FROM hrsa_other_deduction t
left join hrsa_free_income a on t.id=a.main_id and a.delete_type=0 and a.income_category=#{param.incomeCategory}
left join hrsa_derate_deduction b on t.id=b.main_id and b.delete_type=0 and b.income_category=#{param.incomeCategory}
left join hrsa_endowment_insurance c on t.id=c.main_id and c.delete_type=0 and c.income_category=#{param.incomeCategory}
left join hrsa_grant_donation d on t.id=d.main_id and d.delete_type=0 and d.income_category=#{param.incomeCategory}
left join hrsa_health_insurance e on t.id=e.main_id and e.delete_type=0 and e.income_category=#{param.incomeCategory}
left join hrsa_other_derate_deduction f on t.id=f.main_id and f.delete_type=0 and f.income_category=#{param.incomeCategory}
left join hrsa_personal_pension g on t.id=g.main_id and g.delete_type=0 and g.income_category=#{param.incomeCategory}
where t.delete_type=0
and t.declare_month = #{param.declareMonth}
<if test="param.taxAgentId != null">
and t.tax_agent_id = #{param.taxAgentId}
</if>
<if test="param.employeeIds != null and param.employeeIds.size()>0">
AND t.employee_id IN
<foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
#{employeeId}
</foreach>
</if>
<if test="param.taxAgentIds != null and param.taxAgentIds.size()>0">
AND t.tax_agent_id IN
<foreach collection="param.taxAgentIds" open="(" item="taxAgentId" separator="," close=")">
#{taxAgentId}
</foreach>
</if>
</select>
</mapper>

View File

@ -16,6 +16,7 @@
<result column="tax_year_month" property="taxYearMonth"/>
<result column="tenant_key" property="tenantKey"/>
<result column="update_time" property="updateTime"/>
<result column="income_category" property="incomeCategory"/>
</resultMap>
<!-- 表字段 -->
@ -36,6 +37,7 @@
, t.tax_year_month
, t.tenant_key
, t.update_time
, t.income_category
</sql>
<!-- 查询全部 -->
@ -103,6 +105,9 @@
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="incomeCategory != null">
AND income_category = #{incomeCategory}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
@ -160,6 +165,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="incomeCategory != null">
income_category,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="createTime != null">
@ -204,6 +212,9 @@
<if test="updateTime != null">
#{updateTime},
</if>
<if test="incomeCategory != null">
#{incomeCategory},
</if>
</trim>
</insert>
@ -225,6 +236,7 @@
tax_year_month=#{taxYearMonth},
tenant_key=#{tenantKey},
update_time=#{updateTime},
income_category=#{incomeCategory},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -273,6 +285,9 @@
<if test="updateTime != null">
update_time=#{updateTime},
</if>
<if test="income_category != null">
income_category=#{incomeCategory},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

@ -22,6 +22,7 @@
<result column="voucher_no" property="voucherNo"/>
<result column="voucher_type" property="voucherType"/>
<result column="voucher_type_name" property="voucherTypeName"/>
<result column="income_category" property="incomeCategory"/>
</resultMap>
<!-- 表字段 -->
@ -48,6 +49,7 @@
, t.voucher_no
, t.voucher_type
, t.voucher_type_name
, t.income_category
</sql>
<!-- 查询全部 -->
@ -133,6 +135,9 @@
<if test="voucherTypeName != null">
AND voucher_type_name = #{voucherTypeName}
</if>
<if test="incomeCategory != null">
AND income_category = #{incomeCategory}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
@ -208,6 +213,9 @@
<if test="voucherTypeName != null">
voucher_type_name,
</if>
<if test="incomeCategory != null">
income_category,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="collectSource != null">
@ -270,6 +278,9 @@
<if test="voucherTypeName != null">
#{voucherTypeName},
</if>
<if test="incomeCategory != null">
#{incomeCategory},
</if>
</trim>
</insert>
@ -297,6 +308,7 @@
voucher_no=#{voucherNo},
voucher_type=#{voucherType},
voucher_type_name=#{voucherTypeName},
income_category=#{incomeCategory},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
@ -363,6 +375,9 @@
<if test="voucherTypeName != null">
voucher_type_name=#{voucherTypeName},
</if>
<if test="incomeCategory != null">
income_category=#{incomeCategory},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>

View File

@ -98,6 +98,16 @@ public interface OtherDeductionService {
*/
List<OtherDeductionPO> getOtherDeductionList(YearMonth declareMonth, List<Long> employeeIds, List<Long> taxAgentIds);
/**
* 按照申报表类型获取其他免税扣除数据
* @param declareMonth
* @param employeeIds
* @param taxAgentIds
* @param incomeCategory
* @return
*/
List<OtherDeductionPO> getOtherDeductionList(YearMonth declareMonth, List<Long> employeeIds, List<Long> taxAgentIds, Integer incomeCategory);
/**
* 编辑数据
*/

View File

@ -1,5 +1,6 @@
package com.engine.salary.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil;
import com.alibaba.fastjson.JSONObject;
import com.api.formmode.mybatis.util.SqlProxyHandle;
@ -23,6 +24,7 @@ import com.engine.salary.enums.OperateTypeEnum;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.datacollection.DataCollectionEmployeeTypeEnum;
import com.engine.salary.enums.datacollection.TaxFreeTypeEnum;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.enums.auth.AuthFilterTypeEnum;
import com.engine.salary.exception.SalaryRunTimeException;
@ -448,7 +450,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
List<Map> errorData = new ArrayList<>();
//免税收入
List<FreeIncomeListDTO> freeIncomeList = ExcelParseHelper.parse2Map(fileInputStream, FreeIncomeListDTO.class, 0, 1, 9, "OtherDeductionTemplate.xlsx");
List<FreeIncomeListDTO> freeIncomeList = ExcelParseHelper.parse2Map(fileInputStream, FreeIncomeListDTO.class, 0, 1, 10, "OtherDeductionTemplate.xlsx");
for (int i = 0; i < freeIncomeList.size(); i++) {
FreeIncomeListDTO dto = freeIncomeList.get(i);
@ -557,6 +559,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
}
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName());
if (incomeCategoryEnum == null) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "所得项目不存在!");
errorData.add(errorMessageMap);
errorSum += 1;
} else {
freeIncomePO.setIncomeCategory(incomeCategoryEnum.getValue());
}
//免税收入
String freeIncome = dto.getFreeItem();
String freeProperty = dto.getFreeProperty();
@ -602,7 +614,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
// 错误excel内容
List<Map> errorData = new ArrayList<>();
List<HealthInsuranceListDTO> dtoList = ExcelParseHelper.parse2Map(fileInputStream, HealthInsuranceListDTO.class, 1, 1, 11, "OtherDeductionTemplate.xlsx");
List<HealthInsuranceListDTO> dtoList = ExcelParseHelper.parse2Map(fileInputStream, HealthInsuranceListDTO.class, 1, 1, 12, "OtherDeductionTemplate.xlsx");
for (int i = 0; i < dtoList.size(); i++) {
HealthInsuranceListDTO dto = dtoList.get(i);
@ -711,6 +723,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
}
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName());
if (incomeCategoryEnum == null) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "所得项目不存在!");
errorData.add(errorMessageMap);
errorSum += 1;
} else {
po.setIncomeCategory(incomeCategoryEnum.getValue());
}
po.setIdentificationNumber(dto.getIdentificationNumber());
po.setEffectiveDate(dto.getEffectiveDate());
po.setYearPremium(dto.getYearPremium());
@ -752,7 +774,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
// 错误excel内容
List<Map> errorData = new ArrayList<>();
List<EndowmentInsuranceListDTO> derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 11, "OtherDeductionTemplate.xlsx");
List<EndowmentInsuranceListDTO> derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 13, "OtherDeductionTemplate.xlsx");
for (int i = 0; i < derateDeductionList.size(); i++) {
EndowmentInsuranceListDTO dto = derateDeductionList.get(i);
@ -861,6 +883,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
}
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName());
if (incomeCategoryEnum == null) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "所得项目不存在!");
errorData.add(errorMessageMap);
errorSum += 1;
} else {
po.setIncomeCategory(incomeCategoryEnum.getValue());
}
po.setAccountNumber(dto.getAccountNumber());
po.setCheckCode(dto.getCheckCode());
po.setYearPremium(dto.getYearPremium());
@ -904,7 +936,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
// 错误excel内容
List<Map> errorData = new ArrayList<>();
List<GrantDonationListDTO> dtoList = ExcelParseHelper.parse2Map(fileInputStream, GrantDonationListDTO.class, 3, 1, 13, "OtherDeductionTemplate.xlsx");
List<GrantDonationListDTO> dtoList = ExcelParseHelper.parse2Map(fileInputStream, GrantDonationListDTO.class, 3, 1, 14, "OtherDeductionTemplate.xlsx");
for (int i = 0; i < dtoList.size(); i++) {
GrantDonationListDTO dto = dtoList.get(i);
@ -1013,6 +1045,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
}
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName());
if (incomeCategoryEnum == null) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "所得项目不存在!");
errorData.add(errorMessageMap);
errorSum += 1;
} else {
po.setIncomeCategory(incomeCategoryEnum.getValue());
}
po.setRecipientName(dto.getRecipientName());
po.setTaxCode(dto.getTaxCode());
po.setDonationNumber(dto.getDonationNumber());
@ -1057,7 +1099,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
// 错误excel内容
List<Map> errorData = new ArrayList<>();
List<DerateDeductionListDTO> derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, DerateDeductionListDTO.class, 4, 1, 9, "OtherDeductionTemplate.xlsx");
List<DerateDeductionListDTO> derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, DerateDeductionListDTO.class, 4, 1, 10, "OtherDeductionTemplate.xlsx");
for (int i = 0; i < derateDeductionList.size(); i++) {
DerateDeductionListDTO dto = derateDeductionList.get(i);
@ -1166,6 +1208,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
}
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName());
if (incomeCategoryEnum == null) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "所得项目不存在!");
errorData.add(errorMessageMap);
errorSum += 1;
} else {
po.setIncomeCategory(incomeCategoryEnum.getValue());
}
po.setDerateAmount(dto.getDerateAmount());
po.setDerateItem(dto.getDerateItem());
po.setDerateProperty(dto.getDerateProperty());
@ -1206,7 +1258,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
// 错误excel内容
List<Map> errorData = new ArrayList<>();
List<OtherDerateDeductionListDTO> dtoList = ExcelParseHelper.parse2Map(fileInputStream, OtherDerateDeductionListDTO.class, 5, 1, 8, "OtherDeductionTemplate.xlsx");
List<OtherDerateDeductionListDTO> dtoList = ExcelParseHelper.parse2Map(fileInputStream, OtherDerateDeductionListDTO.class, 5, 1, 9, "OtherDeductionTemplate.xlsx");
for (int i = 0; i < dtoList.size(); i++) {
OtherDerateDeductionListDTO dto = dtoList.get(i);
@ -1315,6 +1367,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
}
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName());
if (incomeCategoryEnum == null) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "所得项目不存在!");
errorData.add(errorMessageMap);
errorSum += 1;
} else {
po.setIncomeCategory(incomeCategoryEnum.getValue());
}
po.setOtherDeduction(dto.getOtherDeduction());
po.setRemark(dto.getRemark());
@ -1355,7 +1417,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
// 错误excel内容
List<Map> errorData = new ArrayList<>();
List<PersonalPensionListDTO> dtoList = ExcelParseHelper.parse2Map(fileInputStream, PersonalPensionListDTO.class, 6, 1, 9, "OtherDeductionTemplate.xlsx");
List<PersonalPensionListDTO> dtoList = ExcelParseHelper.parse2Map(fileInputStream, PersonalPensionListDTO.class, 6, 1, 10, "OtherDeductionTemplate.xlsx");
for (int i = 0; i < dtoList.size(); i++) {
PersonalPensionListDTO dto = dtoList.get(i);
@ -1464,6 +1526,16 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
}
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByDefaultLabel(dto.getIncomeCategoryName());
if (incomeCategoryEnum == null) {
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "所得项目不存在!");
errorData.add(errorMessageMap);
errorSum += 1;
} else {
po.setIncomeCategory(incomeCategoryEnum.getValue());
}
po.setVoucherTypeName(dto.getVoucherTypeName());
po.setVoucherNo(dto.getVoucherNo());
po.setPayAmount(dto.getPayAmount());
@ -1821,6 +1893,42 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
return OtherDeductionBiz.listSome(OtherDeductionPO.builder().declareMonth(SalaryDateUtil.toDateStartOfMonth(declareMonth)).employeeIds(employeeIds).taxAgentIds(taxAgentIds).build());
}
@Override
public List<OtherDeductionPO> getOtherDeductionList(YearMonth declareMonth, List<Long> employeeIds, List<Long> taxAgentIds, Integer incomeCategory) {
if (declareMonth == null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "参数有误:申报月份必传"));
}
if (CollUtil.isEmpty(taxAgentIds)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "参数有误:扣缴义务人必传"));
}
if (incomeCategory == null) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100342, "参数有误:所得项目必传"));
}
List<OtherDeductionPO> otherDeductionPOS = listDetails(OtherDeductionPO.builder().incomeCategory(incomeCategory).declareMonth(SalaryDateUtil.toDateStartOfMonth(declareMonth)).employeeIds(employeeIds).taxAgentIds(taxAgentIds).build());
if (CollUtil.isEmpty(otherDeductionPOS)) {
return new ArrayList<>();
}
otherDeductionPOS.forEach(OtherDeductionPO::handleList);
return otherDeductionPOS;
}
private List<OtherDeductionPO> listDetails(OtherDeductionPO param) {
if (CollectionUtils.isNotEmpty(param.getEmployeeIds())) {
List<List<Long>> partition = Lists.partition(param.getEmployeeIds(), 500);
List<OtherDeductionPO> otherDeductionPOS = new ArrayList<>();
partition.forEach(l -> {
param.setEmployeeIds(l);
otherDeductionPOS.addAll(getOtherDeductionMapper().listDetails(param));
});
return encryptUtil.decryptList(otherDeductionPOS, OtherDeductionPO.class);
} else {
List<OtherDeductionPO> otherDeductionPOS = getOtherDeductionMapper().listDetails(param);
return encryptUtil.decryptList(otherDeductionPOS, OtherDeductionPO.class);
}
}
@Override
public void editData(OtherDeductionParam otherDeductionParam) {
String declareMonthStr = otherDeductionParam.getDeclareMonth();
@ -2257,7 +2365,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
Map<String, List<List<Object>>> map = new LinkedHashMap<>();
List<List<Object>> freeIncomeRowList = new ArrayList<>();
List<Object> freeIncomeTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "免税事项", "免税性质", "免税金额");
List<Object> freeIncomeTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "免税事项", "免税性质", "免税金额");
freeIncomeRowList.add(freeIncomeTitle);
freeIncomeList.forEach(dto -> {
List<Object> row = new ArrayList<>();
@ -2267,6 +2375,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
row.add(dto.getMobile());
row.add(dto.getJobNum());
row.add(dto.getIdNo());
row.add(dto.getIncomeCategoryName());
row.add(dto.getFreeItem());
row.add(dto.getFreeProperty());
row.add(dto.getFreeAmount());
@ -2275,7 +2384,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
map.put("免税收入", freeIncomeRowList);
List<List<Object>> healthInsuranceRowList = new ArrayList<>();
List<Object> healthInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "税优识别码", "保单生效日期", "年度保费", "月度保费", "本期扣除金额");
List<Object> healthInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "税优识别码", "保单生效日期", "年度保费", "月度保费", "本期扣除金额");
healthInsuranceRowList.add(healthInsuranceTitle);
healthInsuranceList.forEach(dto -> {
List<Object> row = new ArrayList<>();
@ -2285,6 +2394,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
row.add(dto.getMobile());
row.add(dto.getJobNum());
row.add(dto.getIdNo());
row.add(dto.getIncomeCategoryName());
row.add(dto.getIdentificationNumber());
row.add(dto.getEffectiveDate());
row.add(dto.getYearPremium());
@ -2296,7 +2406,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
List<List<Object>> endowmentInsuranceRowList = new ArrayList<>();
List<Object> endowmentInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "税延养老账户编号", "报税校验码", "年度保费", "月度保费", "本期扣除金额");
List<Object> endowmentInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "申报扣除月份", "税延养老账户编号", "报税校验码", "年度保费", "月度保费", "本期扣除金额");
endowmentInsuranceRowList.add(endowmentInsuranceTitle);
endowmentInsuranceList.forEach(dto -> {
List<Object> row = new ArrayList<>();
@ -2306,6 +2416,8 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
row.add(dto.getMobile());
row.add(dto.getJobNum());
row.add(dto.getIdNo());
row.add(dto.getIncomeCategoryName());
row.add(dto.getDeductionMonth());
row.add(dto.getAccountNumber());
row.add(dto.getCheckCode());
row.add(dto.getYearPremium());
@ -2316,7 +2428,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
map.put("税延养老保险", endowmentInsuranceRowList);
List<List<Object>> grantDonationRowList = new ArrayList<>();
List<Object> grantDonationTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "受赠单位名称", "受赠单位纳税人识别号", "凭证号", "捐赠日期", "捐赠金额", "扣除比例", "实际扣除金额");
List<Object> grantDonationTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "受赠单位名称", "受赠单位纳税人识别号", "凭证号", "捐赠日期", "捐赠金额", "扣除比例", "实际扣除金额");
grantDonationRowList.add(grantDonationTitle);
grantDonationList.forEach(dto -> {
List<Object> row = new ArrayList<>();
@ -2326,6 +2438,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
row.add(dto.getMobile());
row.add(dto.getJobNum());
row.add(dto.getIdNo());
row.add(dto.getIncomeCategoryName());
row.add(dto.getRecipientName());
row.add(dto.getTaxCode());
row.add(dto.getDonationNumber());
@ -2338,7 +2451,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
map.put("准予扣除的捐赠额", grantDonationRowList);
List<List<Object>> derateDeductionRowList = new ArrayList<>();
List<Object> derateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "减免事项", "减免性质", "减免金额");
List<Object> derateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "减免事项", "减免性质", "减免金额");
derateDeductionRowList.add(derateDeductionTitle);
derateDeductionList.forEach(dto -> {
List<Object> row = new ArrayList<>();
@ -2348,6 +2461,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
row.add(dto.getMobile());
row.add(dto.getJobNum());
row.add(dto.getIdNo());
row.add(dto.getIncomeCategoryName());
row.add(dto.getDerateItem());
row.add(dto.getDerateProperty());
row.add(dto.getDerateAmount());
@ -2356,7 +2470,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
map.put("减免税额", derateDeductionRowList);
List<List<Object>> otherDerateDeductionRowList = new ArrayList<>();
List<Object> otherDerateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "其他免税扣除金额", "备注");
List<Object> otherDerateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "其他免税扣除金额", "备注");
otherDerateDeductionRowList.add(otherDerateDeductionTitle);
otherDerateDeductionList.forEach(dto -> {
List<Object> row = new ArrayList<>();
@ -2366,6 +2480,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
row.add(dto.getMobile());
row.add(dto.getJobNum());
row.add(dto.getIdNo());
row.add(dto.getIncomeCategoryName());
row.add(dto.getOtherDeduction());
row.add(dto.getRemark());
otherDerateDeductionRowList.add(row);
@ -2373,7 +2488,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
map.put("其他", otherDerateDeductionRowList);
List<List<Object>> personalPensionRowList = new ArrayList<>();
List<Object> personalPensionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "凭证类型", "凭证编码", "缴费金额");
List<Object> personalPensionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "所得项目", "凭证类型", "凭证编码", "缴费金额");
personalPensionRowList.add(personalPensionTitle);
personalPensionList.forEach(dto -> {
List<Object> row = new ArrayList<>();
@ -2383,6 +2498,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
row.add(dto.getMobile());
row.add(dto.getJobNum());
row.add(dto.getIdNo());
row.add(dto.getIncomeCategoryName());
row.add(dto.getVoucherTypeName());
row.add(dto.getVoucherNo());
row.add(dto.getPayAmount());
@ -2427,6 +2543,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
dto.setMobile(employee.getMobile());
dto.setJobNum(employee.getWorkcode());
dto.setIdNo(employee.getIdNo());
dto.setIncomeCategoryName(IncomeCategoryEnum.parseByValue(po.getIncomeCategory()).getDefaultLabel());
return dto;
}).collect(Collectors.toList());
return listDTOS;
@ -2715,6 +2832,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
.taxYearMonth(deductionPO.getDeclareMonth())
.employeeId(deductionPO.getEmployeeId())
.taxAgentId(deductionPO.getTaxAgentId())
.incomeCategory(param.getIncomeCategory())
.freeItem(param.getFreeItem())
.freeProperty(param.getFreeProperty())
.freeAmount(param.getFreeAmount())
@ -2734,6 +2852,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
po.setUpdateTime(now);
po.setIncomeCategory(param.getIncomeCategory());
po.setFreeItem(param.getFreeItem());
po.setFreeProperty(param.getFreeProperty());
po.setFreeAmount(param.getFreeAmount());
@ -2762,6 +2881,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
.taxYearMonth(deductionPO.getDeclareMonth())
.employeeId(deductionPO.getEmployeeId())
.taxAgentId(deductionPO.getTaxAgentId())
.incomeCategory(param.getIncomeCategory())
.deductionMonth(param.getDeductionMonth())
.accountNumber(param.getAccountNumber())
.checkCode(param.getCheckCode())
@ -2784,6 +2904,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
po.setUpdateTime(now);
po.setIncomeCategory(param.getIncomeCategory());
po.setDeductionMonth(param.getDeductionMonth());
po.setAccountNumber(param.getAccountNumber());
po.setCheckCode(param.getCheckCode());
@ -2815,6 +2936,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
.taxYearMonth(deductionPO.getDeclareMonth())
.employeeId(deductionPO.getEmployeeId())
.taxAgentId(deductionPO.getTaxAgentId())
.incomeCategory(param.getIncomeCategory())
.recipientName(param.getRecipientName())
.taxCode(param.getTaxCode())
.donationNumber(param.getDonationNumber())
@ -2838,6 +2960,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
po.setUpdateTime(now);
po.setIncomeCategory(param.getIncomeCategory());
po.setRecipientName(param.getRecipientName());
po.setTaxCode(param.getTaxCode());
po.setDonationNumber(param.getDonationNumber());
@ -2870,6 +2993,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
.taxYearMonth(deductionPO.getDeclareMonth())
.employeeId(deductionPO.getEmployeeId())
.taxAgentId(deductionPO.getTaxAgentId())
.incomeCategory(param.getIncomeCategory())
.identificationNumber(param.getIdentificationNumber())
.effectiveDate(param.getEffectiveDate())
.yearPremium(param.getYearPremium())
@ -2891,6 +3015,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
po.setUpdateTime(now);
po.setIncomeCategory(param.getIncomeCategory());
po.setIdentificationNumber(param.getIdentificationNumber());
po.setEffectiveDate(param.getEffectiveDate());
po.setYearPremium(param.getYearPremium());
@ -2921,6 +3046,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
.taxYearMonth(deductionPO.getDeclareMonth())
.employeeId(deductionPO.getEmployeeId())
.taxAgentId(deductionPO.getTaxAgentId())
.incomeCategory(param.getIncomeCategory())
.otherDeduction(param.getOtherDeduction())
.remark(param.getRemark())
.fileStatus(1)
@ -2939,6 +3065,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
po.setUpdateTime(now);
po.setIncomeCategory(param.getIncomeCategory());
po.setOtherDeduction(param.getOtherDeduction());
po.setRemark(param.getRemark());
@ -2966,6 +3093,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
.taxYearMonth(deductionPO.getDeclareMonth())
.employeeId(deductionPO.getEmployeeId())
.taxAgentId(deductionPO.getTaxAgentId())
.incomeCategory(param.getIncomeCategory())
.derateAmount(param.getDerateAmount())
.derateItem(param.getDerateItem())
.derateProperty(param.getDerateProperty())
@ -2985,6 +3113,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
po.setUpdateTime(now);
po.setIncomeCategory(param.getIncomeCategory());
po.setDerateAmount(param.getDerateAmount());
po.setDerateItem(param.getDerateItem());
po.setDerateProperty(param.getDerateProperty());
@ -3013,6 +3142,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
.taxYearMonth(deductionPO.getDeclareMonth())
.employeeId(deductionPO.getEmployeeId())
.taxAgentId(deductionPO.getTaxAgentId())
.incomeCategory(param.getIncomeCategory())
.voucherTypeName(param.getVoucherTypeName())
.voucherNo(param.getVoucherNo())
.payAmount(param.getPayAmount())
@ -3032,6 +3162,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
}
po.setUpdateTime(now);
po.setIncomeCategory(param.getIncomeCategory());
po.setVoucherTypeName(param.getVoucherTypeName());
po.setVoucherNo(param.getVoucherNo());
po.setPayAmount(param.getPayAmount());

View File

@ -2769,12 +2769,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (otherPaymentBaseString != null) {
updateOtherInfo.setOtherPaymentBaseString(otherPaymentBaseString);
}
if (!welBaseDiffSign) {
otherPaymentBaseString = adaptWelBaseLimit(updateOtherInfo.getOtherSchemeId(), updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
if (otherPaymentBaseString != null) {
updateOtherInfo.setOtherPaymentBaseString(otherPaymentBaseString);
}
}
} else {
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "其他福利个人: " + errorMsg;
}
if ( (!welBaseDiffSign) && (!checkWelBaseLimit(updateOtherInfo.getOtherSchemeId(),updateOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg))) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "其他福利公司: " + errorMsg;
}
}
//需要拆分个人和公司福利基数时
if (welBaseDiffSign) {
@ -2840,12 +2850,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (otherPaymentBaseString != null) {
insertOtherInfo.setOtherPaymentBaseString(otherPaymentBaseString);
}
if (!welBaseDiffSign) {
otherPaymentBaseString = adaptWelBaseLimit(insertOtherInfo.getOtherSchemeId(), insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
if (otherPaymentBaseString != null) {
insertOtherInfo.setOtherPaymentBaseString(otherPaymentBaseString);
}
}
} else {
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "其他福利个人:" + errorMsg;
}
if ( (!welBaseDiffSign) && (!checkWelBaseLimit(insertOtherInfo.getOtherSchemeId(),insertOtherInfo.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg))) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"其他福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "其他福利公司:" + errorMsg;
}
}
//需要拆分个人和公司福利基数时
if (welBaseDiffSign) {
@ -2980,12 +3000,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (fundPaymentBaseString != null) {
updateFundInfo.setFundPaymentBaseString(fundPaymentBaseString);
}
if (!welBaseDiffSign) {
fundPaymentBaseString = adaptWelBaseLimit(updateFundInfo.getFundSchemeId(), updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
if (fundPaymentBaseString != null) {
updateFundInfo.setFundPaymentBaseString(fundPaymentBaseString);
}
}
} else {
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "公积金个人" + errorMsg;
}
if ( (!welBaseDiffSign) && (!checkWelBaseLimit(updateFundInfo.getFundSchemeId(),updateFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg))) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "公积金公司" + errorMsg;
}
}
//需要拆分个人和公司福利基数时
@ -3056,12 +3086,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (fundPaymentBaseString != null) {
insertFundInfo.setFundPaymentBaseString(fundPaymentBaseString);
}
if (!welBaseDiffSign) {
fundPaymentBaseString = adaptWelBaseLimit(insertFundInfo.getFundSchemeId(), insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
if (fundPaymentBaseString != null) {
insertFundInfo.setFundPaymentBaseString(fundPaymentBaseString);
}
}
} else {
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "公积金个人:" + errorMsg;
}
if ((!welBaseDiffSign) && (!checkWelBaseLimit(insertFundInfo.getFundSchemeId(),insertFundInfo.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg))) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"公积金福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "公积金公司:" + errorMsg;
}
}
//需要拆分个人和公司福利基数时
@ -3203,12 +3243,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (socialPaymentBaseString != null) {
updateSocialInfo.setSocialPaymentBaseString(socialPaymentBaseString);
}
if (!welBaseDiffSign) {
socialPaymentBaseString = adaptWelBaseLimit(updateSocialInfo.getSocialSchemeId(), updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
if (socialPaymentBaseString != null) {
updateSocialInfo.setSocialPaymentBaseString(socialPaymentBaseString);
}
}
} else {
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "社保个人:" + errorMsg;
}
if ((!welBaseDiffSign) && (!checkWelBaseLimit(updateSocialInfo.getSocialSchemeId(),updateSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg))) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "社保公司:" + errorMsg;
}
}
//需要拆分个人和公司福利基数时
@ -3278,12 +3328,22 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
if (socialPaymentBaseString != null) {
insertSocialInfo.setSocialPaymentBaseString(socialPaymentBaseString);
}
if (!welBaseDiffSign) {
socialPaymentBaseString = adaptWelBaseLimit(insertSocialInfo.getSocialSchemeId(), insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
if (socialPaymentBaseString != null) {
insertSocialInfo.setSocialPaymentBaseString(socialPaymentBaseString);
}
}
} else {
StringBuilder errorMsg = new StringBuilder("");
if (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "社保个人:" + errorMsg;
}
if ((!welBaseDiffSign) && (!checkWelBaseLimit(insertSocialInfo.getSocialSchemeId(),insertSocialInfo.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg))) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0,"社保福利明细中的基数更新内容不符合相关基数上下限要求,请检查后重试!"));
combineErrorMsg = "社保公司:" + errorMsg;
}
}
//需要拆分个人和公司福利基数时
if (welBaseDiffSign) {

View File

@ -1409,6 +1409,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
Boolean otherCheckBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_PERSON.getValue(), errorMsg);
Boolean socialCheckBase2 = true;
Boolean fundCheckBase2 = true;
Boolean otherCheckBase2 = true;
if (!welBaseDiffSign) {
socialCheckBase2 = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
fundCheckBase2 = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
otherCheckBase2 = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
}
Boolean socialCheckComBase = true;
Boolean fundCheckComBase = true;
Boolean otherCheckComBase = true;
@ -1417,17 +1425,17 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
fundCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
otherCheckComBase = getSIArchivesService(user).checkWelBaseLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue(), errorMsg);
}
if (socialCheckBase && fundCheckBase && otherCheckBase && socialCheckComBase && fundCheckComBase && otherCheckComBase) {
if (socialCheckBase && fundCheckBase && otherCheckBase && socialCheckBase2 && fundCheckBase2 && otherCheckBase2 && socialCheckComBase && fundCheckComBase && otherCheckComBase) {
insuranceArchivesAccountPOS.add(insuranceArchivesAccountPO);
} else {
String checkMessage = "该条数据中";
if (!socialCheckBase || !socialCheckComBase) {
if (!socialCheckBase || !socialCheckBase2 || !socialCheckComBase) {
checkMessage = checkMessage + "社保福利基数、";
}
if (!fundCheckBase || !fundCheckComBase) {
if (!fundCheckBase || !fundCheckBase2 || !fundCheckComBase) {
checkMessage = checkMessage + "公积金福利基数、";
}
if (!otherCheckBase || !otherCheckComBase) {
if (!otherCheckBase || !otherCheckBase2 || !otherCheckComBase) {
checkMessage = checkMessage + "其他福利基数、";
}
checkMessage = checkMessage.substring(0, checkMessage.length() - 1);
@ -1447,6 +1455,14 @@ public class SISchemeServiceImpl extends Service implements SISchemeService {
insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(newSocialPaymentBaseString);
insuranceArchivesFundSchemePO.setFundPaymentBaseString(newFundPaymentBaseString);
insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(newOtherPaymentBaseString);
if (!welBaseDiffSign) {
newSocialPaymentBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
newFundPaymentBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesFundSchemePO.getFundSchemeId(), insuranceArchivesFundSchemePO.getFundPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
newOtherPaymentBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesOtherSchemePO.getOtherSchemeId(), insuranceArchivesOtherSchemePO.getOtherPaymentBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());
insuranceArchivesSocialSchemePO.setSocialPaymentBaseString(newSocialPaymentBaseString);
insuranceArchivesFundSchemePO.setFundPaymentBaseString(newFundPaymentBaseString);
insuranceArchivesOtherSchemePO.setOtherPaymentBaseString(newOtherPaymentBaseString);
}
if (welBaseDiffSign) {
String newSocialPaymentComBaseString = getSIArchivesService(user).checkAndBuildWelBaseWithLimit(insuranceArchivesSocialSchemePO.getSocialSchemeId(), insuranceArchivesSocialSchemePO.getSocialPaymentComBaseString(), PaymentScopeEnum.SCOPE_COMPANY.getValue());

View File

@ -23,6 +23,7 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
import com.engine.salary.entity.salarysob.po.SalarySobBackItemPO;
import com.engine.salary.entity.salarysob.po.SalarySobItemPO;
import com.engine.salary.entity.salarysob.po.SalarySobPO;
import com.engine.salary.enums.salaryformula.SalaryFormulaReferenceEnum;
import com.engine.salary.formlua.entity.standard.ExcelResult;
import com.engine.salary.service.*;
@ -126,6 +127,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
List<Long> employeeIds = SalaryEntityUtil.properties(salaryAcctCalculateBO.getSalaryAcctEmployeePOS(), SalaryAcctEmployeePO::getEmployeeId, Collectors.toList());
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIdsAll(employeeIds);
SalarySobCycleDTO salarySobCycleDTO = salaryAcctCalculateBO.getSalarySobCycleDTO();
SalarySobPO salarySobPO = salaryAcctCalculateBO.getSalarySobPO();
List<Long> taxAgentIds = salaryAcctCalculateBO.getSalarySobPO().getTaxAgentIds();
sw.stop();
// 2查询薪资档案的数据
@ -148,7 +150,7 @@ public class SalaryAcctCalculateServiceImpl extends Service implements SalaryAcc
sw.stop();
// 5查询其他免税扣除
sw.start("查询其他免税扣除");
List<OtherDeductionPO> otherDeductionPOS = getOtherDeductionService(user).getOtherDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentIds);
List<OtherDeductionPO> otherDeductionPOS = getOtherDeductionService(user).getOtherDeductionList(salarySobCycleDTO.getTaxCycle(), employeeIds, taxAgentIds,salarySobPO.getIncomeCategory());
sw.stop();
//6查询社保福利
sw.start("查询社保福利");

View File

@ -248,7 +248,14 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
.replace("{1}", SalaryDateUtil.getFormatYearMonth(saveParam.getSalaryMonth())));
}
// 查询薪资所属月的薪资核算记录
salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).taxAgentId(taxAgentId).build());
salaryAcctRecordPOS = listBySalaryMonth(SalaryAcctRecordPO.builder().salaryMonths(salaryMonthDateRange).build());
List<SalarySobPO> salarySobPOS = getSalarySobService(user).listByTaxAgentId(saveParam.getTaxAgentId());
if (CollectionUtils.isEmpty(salarySobPOS)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98874, "{0}该义务人下无账套数据").replace("{0}", saveParam.getSalaryMonth().toString()));
}
List<Long> salarySobIds = salarySobPOS.stream().map(SalarySobPO::getId).collect(Collectors.toList());
salaryAcctRecordPOS.stream().filter(record -> salarySobIds.contains(record.getSalarySobId())).collect(Collectors.toList());
// 无薪资核算记录不允许生成个税申报表
if (CollectionUtils.isEmpty(salaryAcctRecordPOS)) {

View File

@ -719,13 +719,13 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
if (declareReportType == DeclareReportTypeEnum.CLASSIFIED_INCOME) {
//分类所得
Map<String, Object> flsdRequestParam = TaxDeclarationRequest.convert2flsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares);
Map<String, Object> flsdRequestParam = TaxDeclarationRequest.convert2flsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares, taxFreeMap);
requestParam.put("flsd", flsdRequestParam);
}
if (declareReportType == DeclareReportTypeEnum.NONRESIDENT_INCOME) {
//非居民所得代扣代缴 fjmsd
Map<String, Object> fjmsdRequestParam = TaxDeclarationRequest.convert2fjmsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares);
Map<String, Object> fjmsdRequestParam = TaxDeclarationRequest.convert2fjmsdRequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares, taxFreeMap);
requestParam.put("fjmsd", fjmsdRequestParam);
}