几个附表列表

This commit is contained in:
钱涛 2024-12-19 09:53:56 +08:00
parent d14ac4bda3
commit 4a9a001311
19 changed files with 1403 additions and 45 deletions

View File

@ -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;
/**
* 免税收入
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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;
}

View File

@ -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;
/**
* 免税收入
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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;
}

View File

@ -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;
/**
* 免税收入
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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;
}

View File

@ -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;
/**
* 准予扣除的捐赠额
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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;
}

View File

@ -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;
/**
* 商业健康保险
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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;
}

View File

@ -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")

View File

@ -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;
/**
* 商业健康保险
* <p>Copyright: Copyright (c) 2022</p>
* <p>Company: 泛微软件</p>
*
* @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;
}

View File

@ -24,8 +24,4 @@ public class OtherDeductionImportParam {
//税款所属期
String declareMonth;
//个税扣缴义务人
String taxAgentId;
}

View File

@ -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 = "人员类型")

View File

@ -135,4 +135,9 @@ public class OtherDeductionPO {
private List<Long> employeeIds;
private Collection<Long> taxAgentIds;
/**
* 减免税额
*/
private List<FreeIncomePO> freeIncomeList;
}

View File

@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
import java.util.Date;
/**
* 其他免税扣除-减免税额
* 其他免税扣除-其他
* <p>Copyright: Copyright (c) 2024</p>
* <p>Company: 泛微软件</p>
*
@ -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;

View File

@ -0,0 +1,62 @@
package com.engine.salary.enums.datacollection;
import java.util.HashMap;
import java.util.Map;
/**
* 免税归档状态
* <p>Copyright: Copyright (c) 2024</p>
* <p>Company: 泛微软件</p>
*
* @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<String, TaxFreeTypeEnum> 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);
}
}

View File

@ -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<DerateDeductionPO> listAll();
/**
* 条件查询
*
* @return 返回集合没有返回空List
*/
List<DerateDeductionPO> 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<Long> ids);
}

View File

@ -0,0 +1,313 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.engine.salary.mapper.datacollection.DerateDeductionMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.datacollection.po.DerateDeductionPO">
<result column="create_time" property="createTime" />
<result column="creator" property="creator" />
<result column="delete_type" property="deleteType" />
<result column="derate_amount" property="derateAmount" />
<result column="derate_item" property="derateItem" />
<result column="derate_property" property="derateProperty" />
<result column="employee_id" property="employeeId" />
<result column="employee_type" property="employeeType" />
<result column="file_status" property="fileStatus" />
<result column="id" property="id" />
<result column="main_id" property="mainId" />
<result column="tax_agent_id" property="taxAgentId" />
<result column="tax_year_month" property="taxYearMonth" />
<result column="tenant_key" property="tenantKey" />
<result column="update_time" property="updateTime" />
</resultMap>
<!-- 表字段 -->
<sql id="baseColumns">
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
</sql>
<!-- 查询全部 -->
<select id="listAll" resultMap="BaseResultMap">
SELECT
<include refid="baseColumns" />
FROM hrsa_derate_deduction t
WHERE delete_type = 0
</select>
<!-- 根据主键获取单条记录 -->
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
SELECT
<include refid="baseColumns" />
FROM hrsa_derate_deduction t
WHERE id = #{id} AND delete_type = 0
</select>
<!-- 条件查询 -->
<select id="listSome" resultMap="BaseResultMap" parameterType="com.engine.salary.entity.datacollection.po.DerateDeductionPO">
SELECT
<include refid="baseColumns" />
FROM hrsa_derate_deduction t
WHERE delete_type = 0
<if test="createTime != null">
AND create_time = #{createTime}
</if>
<if test="creator != null">
AND creator = #{creator}
</if>
<if test="deleteType != null">
AND delete_type = #{deleteType}
</if>
<if test="derateAmount != null">
AND derate_amount = #{derateAmount}
</if>
<if test="derateItem != null">
AND derate_item = #{derateItem}
</if>
<if test="derateProperty != null">
AND derate_property = #{derateProperty}
</if>
<if test="employeeId != null">
AND employee_id = #{employeeId}
</if>
<if test="employeeType != null">
AND employee_type = #{employeeType}
</if>
<if test="fileStatus != null">
AND file_status = #{fileStatus}
</if>
<if test="id != null">
AND id = #{id}
</if>
<if test="mainId != null">
AND main_id = #{mainId}
</if>
<if test="taxAgentId != null">
AND tax_agent_id = #{taxAgentId}
</if>
<if test="taxYearMonth != null">
AND tax_year_month = #{taxYearMonth}
</if>
<if test="tenantKey != null">
AND tenant_key = #{tenantKey}
</if>
<if test="updateTime != null">
AND update_time = #{updateTime}
</if>
<if test="ids != null and ids.size()>0">
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
ORDER BY id DESC
</select>
<!-- 插入不为NULL的字段 -->
<insert id="insertIgnoreNull" parameterType="com.engine.salary.entity.datacollection.po.DerateDeductionPO">
INSERT INTO hrsa_derate_deduction
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="createTime != null">
create_time,
</if>
<if test="creator != null">
creator,
</if>
<if test="deleteType != null">
delete_type,
</if>
<if test="derateAmount != null">
derate_amount,
</if>
<if test="derateItem != null">
derate_item,
</if>
<if test="derateProperty != null">
derate_property,
</if>
<if test="employeeId != null">
employee_id,
</if>
<if test="employeeType != null">
employee_type,
</if>
<if test="fileStatus != null">
file_status,
</if>
<if test="id != null">
id,
</if>
<if test="mainId != null">
main_id,
</if>
<if test="taxAgentId != null">
tax_agent_id,
</if>
<if test="taxYearMonth != null">
tax_year_month,
</if>
<if test="tenantKey != null">
tenant_key,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
<if test="createTime != null" >
#{createTime},
</if>
<if test="creator != null" >
#{creator},
</if>
<if test="deleteType != null" >
#{deleteType},
</if>
<if test="derateAmount != null" >
#{derateAmount},
</if>
<if test="derateItem != null" >
#{derateItem},
</if>
<if test="derateProperty != null" >
#{derateProperty},
</if>
<if test="employeeId != null" >
#{employeeId},
</if>
<if test="employeeType != null" >
#{employeeType},
</if>
<if test="fileStatus != null" >
#{fileStatus},
</if>
<if test="id != null" >
#{id},
</if>
<if test="mainId != null" >
#{mainId},
</if>
<if test="taxAgentId != null" >
#{taxAgentId},
</if>
<if test="taxYearMonth != null" >
#{taxYearMonth},
</if>
<if test="tenantKey != null" >
#{tenantKey},
</if>
<if test="updateTime != null" >
#{updateTime},
</if>
</trim>
</insert>
<!-- 更新,更新全部字段 -->
<update id="update" parameterType="com.engine.salary.entity.datacollection.po.DerateDeductionPO">
UPDATE hrsa_derate_deduction
<set>
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},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 更新不为NULL的字段 -->
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.datacollection.po.DerateDeductionPO">
UPDATE hrsa_derate_deduction
<set>
<if test="createTime != null" >
create_time=#{createTime},
</if>
<if test="creator != null" >
creator=#{creator},
</if>
<if test="deleteType != null" >
delete_type=#{deleteType},
</if>
<if test="derateAmount != null" >
derate_amount=#{derateAmount},
</if>
<if test="derateItem != null" >
derate_item=#{derateItem},
</if>
<if test="derateProperty != null" >
derate_property=#{derateProperty},
</if>
<if test="employeeId != null" >
employee_id=#{employeeId},
</if>
<if test="employeeType != null" >
employee_type=#{employeeType},
</if>
<if test="fileStatus != null" >
file_status=#{fileStatus},
</if>
<if test="mainId != null" >
main_id=#{mainId},
</if>
<if test="taxAgentId != null" >
tax_agent_id=#{taxAgentId},
</if>
<if test="taxYearMonth != null" >
tax_year_month=#{taxYearMonth},
</if>
<if test="tenantKey != null" >
tenant_key=#{tenantKey},
</if>
<if test="updateTime != null" >
update_time=#{updateTime},
</if>
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<!-- 根据主键删除记录 -->
<delete id="delete">
UPDATE hrsa_derate_deduction
SET delete_type=1
WHERE id = #{id} AND delete_type = 0
</delete>
<delete id="deleteByIds">
UPDATE hrsa_derate_deduction
SET delete_type = 1
WHERE delete_type = 0
AND id IN
<foreach collection="ids" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -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<String, Object> importData(OtherDeductionImportParam importParam);
/**
* 导入明细数据
* @param importParam
* @return
*/
Map<String, Object> importDetailData(OtherDeductionImportParam importParam);
/**
* 获取其他免税扣除数据

View File

@ -43,4 +43,10 @@ public interface TaxDeclarationApiConfigService {
void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam);
void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam);
/**
* 是否开启智能算薪
* @return
*/
boolean enableUse();
}

View File

@ -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<OtherDeductionListDTO> OtherDeductions = ExcelParseHelper.parse2Map(fileInputStream, OtherDeductionListDTO.class, 0, 1, 12, "OtherDeductionTemplate.xlsx");
List<OtherDeductionListDTO> 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<TaxAgentManageRangeEmployeeDTO> 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<String, String> 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<String, String> errorMessageMap = Maps.newHashMap();
@ -387,6 +407,192 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
return apidatas;
}
@Override
public Map<String, Object> importDetailData(OtherDeductionImportParam importParam) {
long currentEmployeeId = user.getUID();
Map<String, Object> apidatas = new HashMap<String, Object>();
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<DataCollectionEmployee> employees = getSalaryEmployeeService(user).listEmployee();
// 获取所有个税扣缴义务人
Collection<TaxAgentManageRangeEmployeeDTO> taxAgentList = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
//税款所属期
Date declareMonth = SalaryDateUtil.stringToDate(declareMonthStr + "-01");
// 获取已经核算的数据
List<SalaryAcctEmployeePO> salaryAcctEmployees = getAddUpDeductionService(user).getAccountedEmployeeData(declareMonthStr);
// 查询已有数据
List<OtherDeductionPO> list = getOtherDeductionMapper().listSome(OtherDeductionPO.builder().declareMonth(declareMonth).build());
// 错误excel内容
List<Map> errorData = new ArrayList<>();
List<OtherDeductionPO> eligibleData = new ArrayList<>();
//免税收入
List<FreeIncomeListDTO> 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<Long> employeeSameIds = new ArrayList<>();
//筛选导入人员信息可以在人力资源池中匹配到的人员信息
List<DataCollectionEmployee> 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<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "姓名不能为空");
errorData.add(errorMessageMap);
errorSum += 1;
} else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) {
Map<String, String> 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<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "姓名错误,系统内不存在该姓名");
errorData.add(errorMessageMap);
errorSum += 1;
}
}
String taxAgentName = dto.getTaxAgentName();
if (StringUtils.isBlank(taxAgentName)) {
//个税扣缴义务人不能为空
Map<String, String> errorMessageMap = Maps.newHashMap();
errorMessageMap.put("message", rowIndex + "个税扣缴义务人不能为空");
errorData.add(errorMessageMap);
errorSum += 1;
} else {
Optional<TaxAgentManageRangeEmployeeDTO> 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<String, String> 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<String, OtherDeductionPO> 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<List<Object>> getExcelRowList(OtherDeductionQueryParam param, boolean hasData) {
long employeeId = user.getUID();
//excel标题
List<Object> title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "免税收入", "减免税额", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金");
List<Object> title = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "入职日期", "免税收入", "商业健康保险", "税延养老保险", "准予扣除的捐赠额", "减免税额", "其他", "个人养老金");
List<List<Object>> rowList = new ArrayList<>();
rowList.add(title);
@ -611,7 +815,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
*/
private List<List<Object>> getExcelRowDetailList(OtherDeductionQueryParam param) {
//excel标题
List<Object> title = Arrays.asList("姓名", "申报月份", "个税扣缴义务人", "部门", "手机号", "工号", "免税收入", "减免税额", "商业健康保险", "税延养老保险", "其他", "准予扣除的捐赠额", "个人养老金");
List<Object> 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<String, List<List<Object>>> map = new LinkedHashMap<>();
List<Object> freeIncomeTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "免税事项", "免税性质", "免税金额");
map.put("免税收入", Arrays.asList(freeIncomeTitle));
List<Object> healthInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "税优识别码", "保单生效日期", "年度保费", "月度保费", "本期扣除金额");
map.put("商业健康保险", Arrays.asList(healthInsuranceTitle));
List<Object> endowmentInsuranceTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "税延养老账户编号", "报税校验码", "年度保费", "月度保费", "本期扣除金额");
map.put("税延养老保险", Arrays.asList(endowmentInsuranceTitle));
List<Object> grantDonationTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "受赠单位名称", "受赠单位纳税人识别号", "凭证号", "捐赠日期", "捐赠金额", "扣除比例", "实际扣除金额");
map.put("准予扣除的捐赠额", Arrays.asList(grantDonationTitle));
List<Object> derateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "减免事项", "减免性质", "减免金额");
map.put("减免税额", Arrays.asList(derateDeductionTitle));
List<Object> otherDerateDeductionTitle = Arrays.asList("姓名", "个税扣缴义务人", "部门", "手机号", "工号", "证件号码", "其他免税扣除金额", "备注");
map.put("其他", Arrays.asList(otherDerateDeductionTitle));
// map.put("个人养老金", rowList);
XSSFWorkbook book = ExcelUtil.genWorkbookV2(map);
return book;
}
}

View File

@ -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<TaxDeclarationApiProfilePO> apiProfiles = getTaxDeclarationApiProfileMapper().listAll();
if (apiProfiles.isEmpty() || TaxDeclareApiProfileEnum.PROD.getValue().equals(apiProfiles.get(0).getApiProfile())) {

View File

@ -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<String, Object> 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);
}
}
/**