在线算税v1
This commit is contained in:
parent
36fb0da4dc
commit
e1e00f4db0
|
|
@ -22,11 +22,11 @@
|
|||
//@Configuration
|
||||
//public class SalaryPermissionConfig {
|
||||
//
|
||||
// @Autowired
|
||||
//
|
||||
// private PermissionConfig permissionConfig;
|
||||
// @Autowired
|
||||
//
|
||||
// private PermissionModuleSourceService permissionModuleSourceService;
|
||||
// @Autowired
|
||||
//
|
||||
// private PermissionModuleTargetService permissionModuleTargetService;
|
||||
//
|
||||
// public static final String TABLE_NAME = "hrsa";
|
||||
|
|
|
|||
|
|
@ -147,6 +147,25 @@ public class SzyhApiConstant {
|
|||
*/
|
||||
public static final String GET_COMPANY_INCOMES = "gateway/iit/report/getCompanyIncomes";
|
||||
|
||||
/**
|
||||
* 个人养老金下载
|
||||
*/
|
||||
public static final String DOWNLOAD_PERSONAL_PENSION = "gateway/iit/personalPension/download";
|
||||
/**
|
||||
* 获取个人养老金下载反馈
|
||||
*/
|
||||
public static final String DOWNLOAD_PERSONAL_PENSION_FEEDBACK = "gateway/iit/personalPension/getDownloadFeedback";
|
||||
/**
|
||||
* 异步计算个税
|
||||
*/
|
||||
public static final String CALCULATE_ASYN_INDIVIDUAL_INCOME_TAX = "gateway/iit/calculateTax/calculateASynIndividualIncomeTax";
|
||||
/**
|
||||
* 查询算税反馈结果
|
||||
*/
|
||||
public static final String ASYN_INDIVIDUAL_INCOME_TAX_FEEDBACK = "gateway/iit/calculateTax/getASynIndividualIncomeTaxFeedback";
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 请求成功状态码
|
||||
|
|
|
|||
|
|
@ -0,0 +1,199 @@
|
|||
package com.engine.salary.entity.salaryacct.bo;
|
||||
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO;
|
||||
import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 薪资核算计算个税
|
||||
*
|
||||
* @author xiajun
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class SalaryCalcTax {
|
||||
|
||||
/**
|
||||
* 薪资核算记录
|
||||
*/
|
||||
private SalaryAcctRecordPO salaryAcctRecord;
|
||||
|
||||
/**
|
||||
* 薪资核算关联的个税扣缴义务人
|
||||
*/
|
||||
private List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents;
|
||||
|
||||
/**
|
||||
* 薪资核算关联的薪资核算人员
|
||||
*/
|
||||
private List<SalaryAcctEmployeePO> salaryAcctEmployees;
|
||||
|
||||
/**
|
||||
* 薪资核算关联的薪资核算结果
|
||||
*/
|
||||
private List<SalaryAcctResultPO> salaryAcctResultValues;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人
|
||||
*/
|
||||
private List<TaxAgentPO> taxAgents;
|
||||
|
||||
/**
|
||||
* 个税扣缴义务人的个税信息
|
||||
*/
|
||||
private List<TaxAgentTaxReturnPO> taxAgentTaxReturns;
|
||||
|
||||
/**
|
||||
* 个税申报表字段
|
||||
*/
|
||||
private List<TaxReportColumnPO> taxReportColumns;
|
||||
|
||||
/**
|
||||
* 薪资账套的个税申报表字段对应
|
||||
*/
|
||||
private List<SalarySobTaxReportRulePO> salarySobTaxReportRules;
|
||||
|
||||
/**
|
||||
* 报送人员
|
||||
*/
|
||||
private List<EmployeeDeclarePO> employeeDeclares;
|
||||
|
||||
public Map<Long, Map<String, Object>> buildCalcTaxRequestParam() {
|
||||
// 薪资核算关联的个税扣缴义务人
|
||||
Map<Long, List<SalaryAcctTaxAgentPO>> salaryAcctAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId);
|
||||
// 薪资核算关联的薪资核算人员
|
||||
Map<Long, List<SalaryAcctEmployeePO>> salaryAcctEmployeeMap = SalaryEntityUtil.group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getTaxAgentId);
|
||||
// 薪资核算关联的薪资核算结果
|
||||
Map<Long, List<SalaryAcctResultPO>> salaryAcctResultValueMap = SalaryEntityUtil.group2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId);
|
||||
// 个税扣款义务人
|
||||
Map<Long, TaxAgentPO> taxAgentMap = SalaryEntityUtil.convert2Map(taxAgents, TaxAgentPO::getId);
|
||||
// 个税扣款义务人的个税信息
|
||||
Map<Long, TaxAgentTaxReturnPO> taxAgentTaxReturnMap = SalaryEntityUtil.convert2Map(taxAgentTaxReturns, TaxAgentTaxReturnPO::getTaxAgentId);
|
||||
// 个税申报表字段
|
||||
Map<String, List<TaxReportColumnPO>> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory);
|
||||
// 薪资账套的个税申报表字段对应
|
||||
Map<String, SalarySobTaxReportRulePO> salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, SalarySobTaxReportRulePO::getReportColumnDataIndex);
|
||||
// 报送人员
|
||||
Map<Long, List<EmployeeDeclarePO>> employeeDeclareMap = SalaryEntityUtil.group2Map(employeeDeclares, EmployeeDeclarePO::getTaxAgentId);
|
||||
|
||||
Map<Long, Map<String, Object>> resultMap = new HashMap<>();
|
||||
|
||||
for (Map.Entry<Long, List<SalaryAcctTaxAgentPO>> entry : salaryAcctAgentMap.entrySet()) {
|
||||
TaxAgentPO taxAgent = taxAgentMap.get(entry.getKey());
|
||||
if (taxAgent == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人不存在或已被删除"));
|
||||
}
|
||||
TaxAgentTaxReturnPO taxAgentTaxReturn = taxAgentTaxReturnMap.get(taxAgent.getId());
|
||||
if (taxAgentTaxReturn == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "个税扣缴义务人没有维护个税信息"));
|
||||
}
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = salaryAcctEmployeeMap.get(taxAgent.getId());
|
||||
if (CollectionUtils.isEmpty(salaryAcctEmployees)) {
|
||||
continue;
|
||||
}
|
||||
List<EmployeeDeclarePO> employeeDeclares = employeeDeclareMap.get(taxAgent.getId());
|
||||
if (CollectionUtils.isEmpty(employeeDeclares)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "该个税扣缴义务人无申报人员"));
|
||||
}
|
||||
|
||||
// 注册的企业信息-->请求参数
|
||||
Map<String, Object> requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn);
|
||||
// 税款所属期
|
||||
requestParam.put("skssq", SalaryDateUtil.getFormatYYYYMM(entry.getValue().get(0).getTaxCycle()));
|
||||
// 综合所得
|
||||
requestParam.put("zhsd", buildZHSDRequestParam(salaryAcctTaxAgents, salaryAcctEmployees,
|
||||
salaryAcctResultValueMap, taxReportColumnMap, salarySobTaxReportRuleMap, employeeDeclares));
|
||||
|
||||
resultMap.put(taxAgent.getId(), requestParam);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
private Map<String, Object> buildZHSDRequestParam(List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents,
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees,
|
||||
Map<Long, List<SalaryAcctResultPO>> salaryAcctResultValueMap,
|
||||
Map<String, List<TaxReportColumnPO>> taxReportColumnMap,
|
||||
Map<String, SalarySobTaxReportRulePO> salarySobTaxReportRuleMap,
|
||||
List<EmployeeDeclarePO> employeeDeclares) {
|
||||
Map<String, List<SalaryAcctEmployeePO>> incomeCategoryKeySalaryAcctEmployeeMap = SalaryEntityUtil
|
||||
.group2Map(salaryAcctEmployees, SalaryAcctEmployeePO::getIncomeCategory);
|
||||
|
||||
Map<String, Object> requestParam = new HashMap<>();
|
||||
|
||||
for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : salaryAcctTaxAgents) {
|
||||
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum
|
||||
.parseByValue(salaryAcctTaxAgent.getIncomeCategory());
|
||||
List<TaxReportColumnPO> taxReportColumns = taxReportColumnMap.get(incomeCategoryEnum.getValue().toString());
|
||||
List<SalaryAcctEmployeePO> subSalaryAcctEmployees = incomeCategoryKeySalaryAcctEmployeeMap.get(incomeCategoryEnum.getValue().toString());
|
||||
Map<Long, SalaryAcctEmployeePO> salaryAcctEmployeeMap = SalaryEntityUtil.convert2Map(subSalaryAcctEmployees, SalaryAcctEmployeePO::getEmployeeId);
|
||||
|
||||
SalaryCalcTaxRequest salaryCalcTaxRequest = new SalaryCalcTaxRequest(salaryAcctEmployeeMap,
|
||||
salaryAcctResultValueMap, taxReportColumns, salarySobTaxReportRuleMap, employeeDeclares);
|
||||
|
||||
switch (incomeCategoryEnum) {
|
||||
case WAGES_AND_SALARIES:
|
||||
requestParam.put("zcgzxj", salaryCalcTaxRequest.buildZCGZXJRequestParam());
|
||||
break;
|
||||
case ONETIME_ANNUAL_BONUS:
|
||||
requestParam.put("qnycxjjsslb", salaryCalcTaxRequest.buildQNYCXJJSSLBRequestParam());
|
||||
break;
|
||||
case COMPENSATION_FOR_RETIRE:
|
||||
requestParam.put("ntycxbcjlb", salaryCalcTaxRequest.buildNTYCXBCJLBRequestParam());
|
||||
break;
|
||||
case COMPENSATION_FOR_DISMISS:
|
||||
requestParam.put("jcldhtycxbcjlb", salaryCalcTaxRequest.buildJCLDHTYCXBCJLBRequestParam());
|
||||
break;
|
||||
case INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE:
|
||||
requestParam.put("grgqjl", salaryCalcTaxRequest.buildGRGQJLRequestParam());
|
||||
break;
|
||||
case ANNUITY_RECEIPT:
|
||||
requestParam.put("qynj", salaryCalcTaxRequest.buildQYNJRequestParam());
|
||||
break;
|
||||
case REMUNERATION_FOR_LABOR:
|
||||
requestParam.put("lwbclb", salaryCalcTaxRequest.buildLWBCLBRequestParam());
|
||||
break;
|
||||
case INCOME_FOR_INSURANCE_SALESMAN:
|
||||
requestParam.put("bxyxy", salaryCalcTaxRequest.buildBXYXYRequestParam());
|
||||
break;
|
||||
case INCOME_FOR_SECURITIES_BROKER:
|
||||
requestParam.put("zqjjr", salaryCalcTaxRequest.buildZQJJRRequestParam());
|
||||
break;
|
||||
case REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR:
|
||||
requestParam.put("qtlxlwbc", salaryCalcTaxRequest.buildQTLXLWBCRequestParam());
|
||||
break;
|
||||
case REMUNERATION_FOR_OTHER_LABOR:
|
||||
requestParam.put("qtflxlwbc", salaryCalcTaxRequest.buildQTFLXLWBCRequestParam());
|
||||
break;
|
||||
case REMUNERATION_FOR_AUTHOR:
|
||||
requestParam.put("gcsdlb", salaryCalcTaxRequest.buildGCSDLBRequestParam());
|
||||
break;
|
||||
case ROYALTIES:
|
||||
requestParam.put("txq", salaryCalcTaxRequest.buildTXQRequestParam());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
return requestParam;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.engine.salary.entity.salaryacct.bo;
|
||||
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import lombok.Data;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 异步算税的反馈结果
|
||||
*/
|
||||
@Data
|
||||
public class SalaryCalcTaxFeedback {
|
||||
|
||||
private Map<String, Object> dataMap;
|
||||
|
||||
private List<EmployeeDeclarePO> employeeDeclares;
|
||||
|
||||
public SalaryCalcTaxFeedback(Map<String, Object> dataMap, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
this.dataMap = dataMap;
|
||||
this.employeeDeclares = employeeDeclares;
|
||||
}
|
||||
|
||||
public Map<Long, String> buildZCGZXJFeedback() {
|
||||
Map<String, String> successDataMap = new HashMap<>();
|
||||
List<Map> successList = JsonUtil.parseList(dataMap.get("sscglb"), Map.class);
|
||||
for (Map map : successList) {
|
||||
// 证件号码
|
||||
String zzhm = Util.null2String(map.get("zzhm"));
|
||||
// 应补退税额
|
||||
String ybtse = Util.null2String(map.get("ybtse"));
|
||||
|
||||
successDataMap.put(zzhm, ybtse);
|
||||
}
|
||||
Map<Long, String> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), successDataMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
public Map<Long, String> buildOtherFeedback() {
|
||||
Map<String, String> successDataMap = new HashMap<>();
|
||||
List<Map> successList = JsonUtil.parseList(dataMap.get("sscglb"), Map.class);
|
||||
for (Map map : successList) {
|
||||
// 证件号码
|
||||
String zzhm = Util.null2String(map.get("zzhm"));
|
||||
// 应补退税额
|
||||
String ybtse = Util.null2String(map.get("yingkjse"));
|
||||
|
||||
successDataMap.put(zzhm, ybtse);
|
||||
}
|
||||
Map<Long, String> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), successDataMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,258 @@
|
|||
package com.engine.salary.entity.salaryacct.bo;
|
||||
|
||||
import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest;
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctEmployeePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctResultPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO;
|
||||
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
|
||||
import com.engine.salary.enums.salaryitem.SalaryDataTypeEnum;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.wbi.util.Util;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class SalaryCalcTaxRequest {
|
||||
|
||||
private Map<Long, SalaryAcctEmployeePO> salaryAcctEmployeeMap;
|
||||
private Map<Long, List<SalaryAcctResultPO>> salaryAcctResultValueMap;
|
||||
private List<TaxReportColumnPO> taxReportColumns;
|
||||
private Map<String, SalarySobTaxReportRulePO> salarySobTaxReportRuleMap;
|
||||
private List<EmployeeDeclarePO> employeeDeclares;
|
||||
|
||||
/**
|
||||
* 正常工资薪金
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> buildZCGZXJRequestParam() {
|
||||
// 人员列表
|
||||
List<Map<String, Object>> RYLBRequestParam = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares);
|
||||
// 正常工资薪金列表
|
||||
List<Map<String, Object>> ZCGZXJLBRequestParams = buildRequestParams(IncomeCategoryEnum.WAGES_AND_SALARIES,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
// 人员列表
|
||||
param.put("rylb", RYLBRequestParam);
|
||||
// 正常工资薪金列表
|
||||
param.put("zcgzxjlb", ZCGZXJLBRequestParams);
|
||||
// 正常工资薪金是否需要专项
|
||||
param.put("zcgzxjsfxyzx", 0);
|
||||
// 正常工资薪金是否传入专项累计
|
||||
param.put("zcgzxjsfcrlj", 1);
|
||||
// 是否传入累计个人养老金,2使用传入数据
|
||||
param.put("gryljcl", 2);
|
||||
|
||||
return param;
|
||||
}
|
||||
|
||||
/**
|
||||
* 全年一次性奖金收入
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildQNYCXJJSSLBRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.ONETIME_ANNUAL_BONUS,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 稿酬所得
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildGCSDLBRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_AUTHOR,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 一般劳务报酬所得
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildLWBCLBRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_LABOR,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解除劳动合同一次性补偿金
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildJCLDHTYCXBCJLBRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.COMPENSATION_FOR_DISMISS,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保险营销员佣金收入
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> buildBXYXYRequestParam() {
|
||||
List<Map<String, Object>> requestParams = buildRequestParams(IncomeCategoryEnum.INCOME_FOR_INSURANCE_SALESMAN,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
// 保险营销员薪金列表
|
||||
param.put("bxyxylwbclb", requestParams);
|
||||
// 是否传入累计个人养老金,2使用传入数据
|
||||
param.put("gryljcl", 2);
|
||||
return param;
|
||||
}
|
||||
|
||||
/**
|
||||
* 证券经纪人佣金收入
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> buildZQJJRRequestParam() {
|
||||
List<Map<String, Object>> requestParams = buildRequestParams(IncomeCategoryEnum.INCOME_FOR_SECURITIES_BROKER,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
// 证券经纪人薪金列表
|
||||
param.put("zqjjrsdlb", requestParams);
|
||||
// 是否传入累计个人养老金,2使用传入数据
|
||||
param.put("gryljcl", 2);
|
||||
return param;
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他连续劳务报酬所得
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> buildQTLXLWBCRequestParam() {
|
||||
List<Map<String, Object>> requestParams = buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("qtlxlwbclb", Lists.newArrayList());
|
||||
// 是否传入累计个人养老金,2使用传入数据
|
||||
param.put("gryljcl", 2);
|
||||
return param;
|
||||
}
|
||||
|
||||
/**
|
||||
* 特许权使用费所得
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildTXQRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.ROYALTIES,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人股权激励收入
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildGRGQJLRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 年金领取
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildQYNJRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.ANNUITY_RECEIPT,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 内退一次性补偿金
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildNTYCXBCJLBRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.COMPENSATION_FOR_RETIRE,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 其他非连续劳务报酬所得
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> buildQTFLXLWBCRequestParam() {
|
||||
return buildRequestParams(IncomeCategoryEnum.REMUNERATION_FOR_OTHER_LABOR,
|
||||
employeeDeclares, salaryAcctEmployeeMap, salaryAcctResultValueMap);
|
||||
}
|
||||
|
||||
private List<Map<String, Object>> buildRequestParams(IncomeCategoryEnum incomeCategoryEnum,
|
||||
List<EmployeeDeclarePO> employeeDeclares,
|
||||
Map<Long, SalaryAcctEmployeePO> salaryAcctEmployeeMap,
|
||||
Map<Long, List<SalaryAcctResultPO>> salaryAcctResultValueMap) {
|
||||
List<Map<String, Object>> requestParams = Lists.newArrayListWithExpectedSize(salaryAcctResultValueMap.size());
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
SalaryAcctEmployeePO salaryAcctEmployee = salaryAcctEmployeeMap.get(employeeDeclare.getEmployeeId());
|
||||
if (salaryAcctEmployee == null) {
|
||||
continue;
|
||||
}
|
||||
List<SalaryAcctResultPO> salaryAcctResultValue = salaryAcctResultValueMap.get(salaryAcctEmployee.getId());
|
||||
if (salaryAcctResultValue == null) {
|
||||
continue;
|
||||
}
|
||||
Map<Long, String> map = SalaryEntityUtil.convert2Map(salaryAcctResultValue, SalaryAcctResultPO::getSalaryItemId, SalaryAcctResultPO::getResultValue);
|
||||
Map<String, Object> requestParam = buildRequestParam(incomeCategoryEnum, employeeDeclare, map);
|
||||
if (MapUtils.isNotEmpty(requestParam)) {
|
||||
requestParams.add(requestParam);
|
||||
}
|
||||
}
|
||||
return requestParams;
|
||||
}
|
||||
|
||||
private Map<String, Object> buildRequestParam(IncomeCategoryEnum incomeCategoryEnum,
|
||||
EmployeeDeclarePO employeeDeclare,
|
||||
Map<Long, String> salaryAcctResultValue) {
|
||||
if (CollectionUtils.isEmpty(taxReportColumns)) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
Map<String, Object> requestParam = Maps.newHashMap();
|
||||
// 姓名
|
||||
requestParam.put("xm", employeeDeclare.getEmployeeName());
|
||||
// 证件类型
|
||||
requestParam.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
|
||||
// 证件号码
|
||||
requestParam.put("zzhm", employeeDeclare.getCardNum());
|
||||
// 所得项目
|
||||
requestParam.put("sdxm", incomeCategoryEnum.getDefaultLabel());
|
||||
|
||||
for (TaxReportColumnPO taxReportColumn : taxReportColumns) {
|
||||
Long dataKey = null;
|
||||
SalarySobTaxReportRulePO salarySobTaxReportRule = salarySobTaxReportRuleMap.get(taxReportColumn.getReportColumnDataIndex());
|
||||
if (salarySobTaxReportRule != null && salarySobTaxReportRule.getSalaryItemId() != null) {
|
||||
dataKey = salarySobTaxReportRule.getSalaryItemId();
|
||||
}
|
||||
String value = salaryAcctResultValue.getOrDefault(dataKey, StringUtils.EMPTY);
|
||||
if (Objects.equals(taxReportColumn.getDataType(), SalaryDataTypeEnum.NUMBER.getValue())) {
|
||||
value = Util.getBigDecimalValue(value, BigDecimal.ZERO).toPlainString();
|
||||
} else if (Objects.equals(taxReportColumn.getDataType(), "integer")) {
|
||||
value = Util.getBigDecimalValue(value, BigDecimal.ZERO).setScale(0, RoundingMode.HALF_UP).toPlainString();
|
||||
}
|
||||
requestParam.put(taxReportColumn.getRequestParamKey(), value);
|
||||
}
|
||||
return requestParam;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.engine.salary.entity.salaryacct.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 薪资核算计算个税
|
||||
*
|
||||
* @author xiajun
|
||||
*/
|
||||
@Data
|
||||
public class SalaryCalcTaxInfoDTO {
|
||||
|
||||
/**
|
||||
* 是否开启智能算薪
|
||||
*/
|
||||
private boolean enableTaxDeclarationApiConfig;
|
||||
|
||||
/**
|
||||
* 是否显示计算个税按钮
|
||||
*/
|
||||
private boolean showCalcTaxButton;
|
||||
|
||||
/**
|
||||
* 是否显示获取个税计算反馈按钮
|
||||
*/
|
||||
private boolean showCalcTaxFeedbackButton;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.engine.salary.entity.salaryacct.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 薪资核算计算个税
|
||||
*
|
||||
* @author xiajun
|
||||
*/
|
||||
@Data
|
||||
public class SalaryCalcTaxParam {
|
||||
|
||||
/**
|
||||
* 参数错误,薪资核算记录ID不能为空
|
||||
*/
|
||||
@DataCheck(require = true,message = "薪资核算记录ID不能为空")
|
||||
private Long salaryAcctRecordId;
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.engine.salary.entity.salaryacct.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ElogTransform(name = "薪资核算在线计算个税请求")
|
||||
//hrsa_acct_calc_tax_req
|
||||
public class SalaryAcctCalcTaxReqPO {
|
||||
|
||||
@ElogTransform(name = "主键id", ignore = true)
|
||||
private Long id;
|
||||
|
||||
@ElogTransform(name = "薪资核算记录", ignore = true)
|
||||
private Long salaryAcctRecordId;
|
||||
|
||||
@ElogTransform(name = "个税扣缴义务人id", ignore = true)
|
||||
private Long taxAgentId;
|
||||
|
||||
@ElogTransform(name = "请求requestId", ignore = true)
|
||||
private String requestId;
|
||||
|
||||
@ElogTransform(name = "租户key", ignore = true)
|
||||
private String tenantKey;
|
||||
|
||||
@ElogTransform(name = "创建人id", ignore = true)
|
||||
private Long creator;
|
||||
|
||||
@ElogTransform(name = "是否删除", ignore = true)
|
||||
private Integer deleteType;
|
||||
|
||||
@ElogTransform(name = "创建时间", ignore = true)
|
||||
private Date createTime;
|
||||
|
||||
@ElogTransform(name = "更新时间", ignore = true)
|
||||
private Date updateTime;
|
||||
|
||||
//--------条件----------
|
||||
//主键id集合
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
@ -1,7 +1,10 @@
|
|||
package com.engine.salary.enums.salarysob;
|
||||
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.enums.BaseEnum;
|
||||
import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTaxFeedbackResponse;
|
||||
import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -21,155 +24,325 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
// todo 多语言
|
||||
WAGES_AND_SALARIES(1, "0101", "正常工资薪金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160487) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160488) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getLwbclb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160489) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQnycxjjsslb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181936) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getNtycxbcjlb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181937) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getJcldhtycxbcjlb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181938) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGrgqjl().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
ANNUITY_RECEIPT(110, "0110", "年金领取", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181939) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQynj().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181940) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getBxyxy().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181942) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZqjjr().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181943) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtlxlwbc().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 175330) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getQtflxlwbc().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181944) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getGcsdlb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
ROYALTIES(600, "0600", "特许权使用费所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181945) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw> zhsd = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb();
|
||||
List<List<Object>> zhsdSheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.zhsd.zcgzxj.zhsdscjgbw.class, zhsd);
|
||||
result.put(this.getDefaultLabel(), zhsdSheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getTxq().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
NON_RESIDENT_INCOME_WAGES_AND_SALARIES(700, "0700", "无住所个人正常工资薪金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw> fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb();
|
||||
List<List<Object>> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd);
|
||||
result.put(this.getDefaultLabel(), sheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjgzxjlb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
NON_RESIDENT_INCOME_MONTHLY_BONUS(710, "0710", "无住所个人数月奖金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw> fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb();
|
||||
List<List<Object>> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd);
|
||||
result.put(this.getDefaultLabel(), sheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getWjrysyjjlb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
},
|
||||
NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR(720, "0720", "一般劳务报酬所得", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw> fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb();
|
||||
List<List<Object>> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd);
|
||||
result.put(this.getDefaultLabel(), sheetData);
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getLwbclb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
},
|
||||
NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
|
||||
@Override
|
||||
public Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
public void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse) {
|
||||
List<GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw> fjmsd = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb();
|
||||
List<List<Object>> sheetData = ExcelUtil.getExcelSheetData(GetDeclareTaxResultFeedbackResponse.Body.fjmsd.fjmsdssjgdx.fjmsdscbw.class, fjmsd);
|
||||
result.put(this.getDefaultLabel(), sheetData);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.result> sscglb = declareTaxResultFeedbackResponse.getBody().getFjmsd().getJcldhtycxbcjlb().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.result::getZzhm);
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> resultMap = new HashMap<>();
|
||||
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
|
||||
resultMap.put(employeeDeclare.getEmployeeId(), idNoResultMap.get(employeeDeclare.getCardNum()));
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -192,7 +365,11 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
this.labelId = labelId;
|
||||
}
|
||||
|
||||
public abstract Map<String, List<List<Object>>> parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse);
|
||||
public abstract void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse);
|
||||
|
||||
|
||||
public abstract Map<Long,GetASynIndividualIncomeTaxFeedbackResponse.Body.result> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares);
|
||||
|
||||
|
||||
@Override
|
||||
public Integer getValue() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
package com.engine.salary.mapper.salaryacct;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctCalcTaxReqPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public interface SalaryAcctCalcTaxReqMapper {
|
||||
|
||||
/**
|
||||
* 查询所有记录
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalaryAcctCalcTaxReqPO> listAll();
|
||||
|
||||
/**
|
||||
* 条件查询
|
||||
*
|
||||
* @return 返回集合,没有返回空List
|
||||
*/
|
||||
List<SalaryAcctCalcTaxReqPO> listSome(SalaryAcctCalcTaxReqPO acctCalcTaxReq);
|
||||
|
||||
|
||||
/**
|
||||
* 根据主键查询
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 返回记录,没有返回null
|
||||
*/
|
||||
SalaryAcctCalcTaxReqPO getById(Long id);
|
||||
|
||||
/**
|
||||
* 新增,忽略null字段
|
||||
*
|
||||
* @param acctCalcTaxReq 新增的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int insertIgnoreNull(SalaryAcctCalcTaxReqPO acctCalcTaxReq);
|
||||
|
||||
|
||||
/**
|
||||
* 修改,修改所有字段
|
||||
*
|
||||
* @param acctCalcTaxReq 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int update(SalaryAcctCalcTaxReqPO acctCalcTaxReq);
|
||||
|
||||
/**
|
||||
* 修改,忽略null字段
|
||||
*
|
||||
* @param acctCalcTaxReq 修改的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int updateIgnoreNull(SalaryAcctCalcTaxReqPO acctCalcTaxReq);
|
||||
|
||||
/**
|
||||
* 删除记录
|
||||
*
|
||||
* @param acctCalcTaxReq 待删除的记录
|
||||
* @return 返回影响行数
|
||||
*/
|
||||
int delete(SalaryAcctCalcTaxReqPO acctCalcTaxReq);
|
||||
|
||||
/**
|
||||
* 批量删除记录
|
||||
* @param ids 主键id集合
|
||||
*/
|
||||
void deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
void deleteByRecordId(Long salaryAcctRecordId);
|
||||
}
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
<?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.salaryacct.SalaryAcctCalcTaxReqMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.salary.entity.salaryacct.po.SalaryAcctCalcTaxReqPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="salary_acct_record_id" property="salaryAcctRecordId"/>
|
||||
<result column="tax_agent_id" property="taxAgentId"/>
|
||||
<result column="request_id" property="requestId"/>
|
||||
<result column="tenant_key" property="tenantKey"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
id
|
||||
, t.salary_acct_record_id
|
||||
, t.tax_agent_id
|
||||
, t.request_id
|
||||
, t.tenant_key
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="listAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_acct_calc_tax_req t
|
||||
WHERE delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据主键获取单条记录 -->
|
||||
<select id="getById" resultMap="BaseResultMap" parameterType="Long">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_acct_calc_tax_req t
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<!-- 条件查询 -->
|
||||
<select id="listSome" resultMap="BaseResultMap"
|
||||
parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctCalcTaxReqPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_acct_calc_tax_req t
|
||||
WHERE delete_type = 0
|
||||
<if test="id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="salaryAcctRecordId != null">
|
||||
AND salary_acct_record_id = #{salaryAcctRecordId}
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
AND tax_agent_id = #{taxAgentId}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND request_id = #{requestId}
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
AND tenant_key = #{tenantKey}
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
AND creator = #{creator}
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
AND delete_type = #{deleteType}
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
AND create_time = #{createTime}
|
||||
</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.salaryacct.po.SalaryAcctCalcTaxReqPO">
|
||||
INSERT INTO hrsa_acct_calc_tax_req
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="salaryAcctRecordId != null">
|
||||
salary_acct_record_id,
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
tax_agent_id,
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
request_id,
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id},
|
||||
</if>
|
||||
<if test="salaryAcctRecordId != null">
|
||||
#{salaryAcctRecordId},
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
#{taxAgentId},
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
#{requestId},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
#{tenantKey},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<!-- 更新,更新全部字段 -->
|
||||
<update id="update" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctCalcTaxReqPO">
|
||||
UPDATE hrsa_acct_calc_tax_req
|
||||
<set>
|
||||
salary_acct_record_id=#{salaryAcctRecordId},
|
||||
tax_agent_id=#{taxAgentId},
|
||||
request_id=#{requestId},
|
||||
tenant_key=#{tenantKey},
|
||||
creator=#{creator},
|
||||
delete_type=#{deleteType},
|
||||
create_time=#{createTime},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 更新不为NULL的字段 -->
|
||||
<update id="updateIgnoreNull" parameterType="com.engine.salary.entity.salaryacct.po.SalaryAcctCalcTaxReqPO">
|
||||
UPDATE hrsa_acct_calc_tax_req
|
||||
<set>
|
||||
<if test="salaryAcctRecordId != null">
|
||||
salary_acct_record_id=#{salaryAcctRecordId},
|
||||
</if>
|
||||
<if test="taxAgentId != null">
|
||||
tax_agent_id=#{taxAgentId},
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
request_id=#{requestId},
|
||||
</if>
|
||||
<if test="tenantKey != null">
|
||||
tenant_key=#{tenantKey},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator=#{creator},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type=#{deleteType},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time=#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time=#{updateTime},
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 根据主键删除记录 -->
|
||||
<delete id="delete">
|
||||
UPDATE hrsa_acct_calc_tax_req
|
||||
SET delete_type=1
|
||||
WHERE id = #{id}
|
||||
AND delete_type = 0
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
UPDATE hrsa_acct_calc_tax_req
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByRecordId">
|
||||
UPDATE hrsa_acct_calc_tax_req
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND salary_acct_record_id = #{salaryAcctRecordId}
|
||||
</delete>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.engine.salary.remote.tax.client;
|
||||
|
||||
import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTaxFeedbackResponse;
|
||||
import com.engine.salary.util.HttpUtil;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SingnatureData;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
public class CalculateClient extends TaxBaseClient{
|
||||
|
||||
public CalculateClient(Long taxAgentId) {
|
||||
super(taxAgentId);
|
||||
}
|
||||
|
||||
public GetASynIndividualIncomeTaxFeedbackResponse getASynIndividualIncomeTaxFeedback(String requestId){
|
||||
String url = super.apiConfig.getHost() + "/gateway/iit/calculateTax/getASynIndividualIncomeTaxFeedback";
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
params.put("requestId", requestId);
|
||||
Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
String res = HttpUtil.getRequest(url, header, params);
|
||||
|
||||
log.info("getDeclareTaxResultFeedback res --- {}", res);
|
||||
return JsonUtil.parseObject(res, GetASynIndividualIncomeTaxFeedbackResponse.class);
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,746 @@
|
|||
package com.engine.salary.remote.tax.response.calculate;
|
||||
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import com.engine.salary.entity.taxpayment.response.BaseResponse;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class GetASynIndividualIncomeTaxFeedbackResponse extends BaseResponse {
|
||||
/**
|
||||
* 返回数据
|
||||
*/
|
||||
private Body body;
|
||||
|
||||
@Data
|
||||
public static class Body {
|
||||
/**
|
||||
* 企业名称 必填:是
|
||||
*/
|
||||
private String qymc;
|
||||
/**
|
||||
* 税号 必填:是
|
||||
*/
|
||||
private String nsrsbh;
|
||||
/**
|
||||
* 地区编号 必填:是 6位行政区划代码,精确到市级,例如:440100,参考省市区编码
|
||||
*/
|
||||
private String areaid;
|
||||
/**
|
||||
* 部门编号 必填:是
|
||||
*/
|
||||
private String bmbh;
|
||||
/**
|
||||
* 部门名称 必填:否
|
||||
*/
|
||||
private String bmmc;
|
||||
/**
|
||||
* 算税月份 必填:是
|
||||
*/
|
||||
private String skssq;
|
||||
/**
|
||||
* 综合所得 必填:是 见综合所得计算结果
|
||||
*/
|
||||
private zhsd zhsd;
|
||||
// /**
|
||||
// * 分类所得 必填:是 见分类所得计算结果
|
||||
// */
|
||||
// private flsd flsd;
|
||||
/**
|
||||
* 非居民所得 必填:是 见非居民所得计算结果
|
||||
*/
|
||||
private fjmsd fjmsd;
|
||||
// /**
|
||||
// * 限售股所得 必填:是 见限售股所得计算结果
|
||||
// */
|
||||
// private xsgsd xsgsd;
|
||||
// /**
|
||||
// * 人员申报失败列表 必填:是 参考人员代报结果对象
|
||||
// */
|
||||
// private rysbsblb rysbsblb;
|
||||
|
||||
|
||||
@Data
|
||||
public static class zhsd {
|
||||
/**
|
||||
* 人员代代报失败列表 参考人员代报结果对象
|
||||
*/
|
||||
private List<rysb> rysbsblb;
|
||||
/**
|
||||
* 正常工资薪金算税结果对象 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx zcgzxj;
|
||||
/**
|
||||
* 全年一次性奖金收入算税结果对象 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx qnycxjjsslb;
|
||||
/**
|
||||
* 稿酬所得算税结果对象 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx gcsdlb;
|
||||
/**
|
||||
* 一般劳务报酬算税结果对象 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx lwbclb;
|
||||
/**
|
||||
* 解除劳动合同一次性补偿金列表 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx jcldhtycxbcjlb;
|
||||
/**
|
||||
* 保险营销员薪金算税结果对象 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx bxyxy;
|
||||
/**
|
||||
* 证券经纪人薪金算税结果对象 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx zqjjr;
|
||||
/**
|
||||
* 特许权算税结果对象 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx txq;
|
||||
/**
|
||||
* 个人股权激励结果对象 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx grgqjl;
|
||||
/**
|
||||
* 企业年金结果对象 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx qynj;
|
||||
/**
|
||||
* 内退一次性补偿金 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx ntycxbcjlb;
|
||||
/**
|
||||
* 其他连续劳务报酬 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx qtlxlwbc;
|
||||
/**
|
||||
* 其他非连续劳务报酬 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx qtflxlwbc;
|
||||
/**
|
||||
* 提前退休一次性补贴 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx tqtxycxbt;
|
||||
/**
|
||||
* 央企负责人绩效薪金延期兑现收入和任期奖励 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx yqfzrsrhjl;
|
||||
/**
|
||||
* 法律援助劳务报酬 参考综合所得算税结果对象
|
||||
*/
|
||||
private ssjgdx flyzlwbclb;
|
||||
|
||||
|
||||
@Data
|
||||
public static class rysb {
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String xm;
|
||||
/**
|
||||
* 证件类型名称
|
||||
*/
|
||||
private String zzlx;
|
||||
/**
|
||||
* 证件号码
|
||||
*/
|
||||
private String zzhm;
|
||||
/**
|
||||
* 代报状态 1 待报送 2 代报中 3 代报失败 4 代报成功
|
||||
*/
|
||||
private String sbzt;
|
||||
/**
|
||||
* 人员认证状态
|
||||
*/
|
||||
private String rzzt;
|
||||
/**
|
||||
* 失败原因
|
||||
*/
|
||||
private String sbyy;
|
||||
/**
|
||||
* 专项代报状态
|
||||
*/
|
||||
private String clzt;
|
||||
/**
|
||||
* 专项代报结果原因
|
||||
*/
|
||||
private String cljgms;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class ssjgdx {
|
||||
/**
|
||||
* 综合算税成功列表 参考综合所得输出结果报文
|
||||
*/
|
||||
private List<result> sscglb;
|
||||
/**
|
||||
* 综合算税失败列表 参考综合所得输出结果报文
|
||||
*/
|
||||
private List<result> sssblb;
|
||||
/**
|
||||
* 综合算税失败原因列表 参考算税失败原因对象
|
||||
*/
|
||||
private List<sssbyy> sssbyylb;
|
||||
/**
|
||||
* 参与综合算税总人数
|
||||
*/
|
||||
private int sszrs;
|
||||
/**
|
||||
* 综合算税失败总人数
|
||||
*/
|
||||
private int sssbrs;
|
||||
/**
|
||||
* 年金上限
|
||||
*/
|
||||
private BigDecimal njsx;
|
||||
/**
|
||||
* 住房公积金上限
|
||||
*/
|
||||
private BigDecimal zfgjjsx;
|
||||
/**
|
||||
* 年平均工资
|
||||
*/
|
||||
private BigDecimal npjgz;
|
||||
/**
|
||||
* 企业上月是否已申报 0:上月未申报 1:上月已申报 2:上上月未申报
|
||||
*/
|
||||
private String qysysfysb;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Data
|
||||
public static class fjmsd {
|
||||
/**
|
||||
* 正常工资薪金(无住所个人正常工资薪金)所得列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx wjgzxjlb;
|
||||
/**
|
||||
* 无住所个人数月奖金列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx wjrysyjjlb;
|
||||
/**
|
||||
* 劳务报酬列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx lwbclb;
|
||||
/**
|
||||
* 稿酬所得列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx gcsdlb;
|
||||
/**
|
||||
* 利息姑息红利所得列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx lxgxhllb;
|
||||
/**
|
||||
* 股权转让列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx gqzrlb;
|
||||
/**
|
||||
* 其他财产转让列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx qtcczrlb;
|
||||
/**
|
||||
* 偶然所得列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx orsdlb;
|
||||
/**
|
||||
* 解除劳动合同一次性补偿金列表 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx jcldhtycxbcjlb;
|
||||
/**
|
||||
* 保险营销员薪金算税结果对象 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx bxyxy;
|
||||
/**
|
||||
* 证券经纪人薪金算税结果对象 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx zqjjr;
|
||||
/**
|
||||
* 个人股权激励结果对象 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx grgqjl;
|
||||
/**
|
||||
* 特许权使用费所得 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx txqsyfsd;
|
||||
/**
|
||||
* 个人房屋出租所得 参考非居民所得算税结果对象
|
||||
*/
|
||||
private ssjgdx grfwczsd;
|
||||
|
||||
@Data
|
||||
public static class ssjgdx {
|
||||
/**
|
||||
* 非居民算税成功列表 参考输入报文非居民所得输出结果报文
|
||||
*/
|
||||
private List<result> sscglb;
|
||||
/**
|
||||
* 非居民算税失败列表 参考输入报文非居民所得输出结果报文
|
||||
*/
|
||||
private List<result> sssblb;
|
||||
/**
|
||||
* 非居民算税失败原因列表 参考算税失败原因对象
|
||||
*/
|
||||
private List<sssbyy> sssbyylb;
|
||||
/**
|
||||
* 参与非居民算税总人数
|
||||
*/
|
||||
private int sszrs;
|
||||
/**
|
||||
* 非居民算税失败总人数
|
||||
*/
|
||||
private int sssbrs;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class result {
|
||||
|
||||
//--------------综合所得输出结果报文------------------------------
|
||||
|
||||
/**
|
||||
* 是否明细申报 必填:否 是或者否
|
||||
*/
|
||||
private String sfmxsb;
|
||||
/**
|
||||
* 姓名 必填:否 如果是汇总申报返回空
|
||||
*/
|
||||
@TableTitle(title = "姓名", dataIndex = "xm",key = "xm")
|
||||
private String xm;
|
||||
/**
|
||||
* 证件类型 必填:否 见证件类型字典 如果是汇总申报返回空
|
||||
*/
|
||||
private String zzlx;
|
||||
/**
|
||||
* 证件号码 必填:否 如果是汇总申报返回空
|
||||
*/
|
||||
private String zzhm;
|
||||
/**
|
||||
* 任职受雇日期 必填:是 格式YYYY-MM-DD
|
||||
*/
|
||||
private String rzsgrq;
|
||||
/**
|
||||
* 离职日期 必填:否 格式YYYY-MM-DD
|
||||
*/
|
||||
private String lzrq;
|
||||
/**
|
||||
* 当期收入额 必填:是 不填写默认为0
|
||||
*/
|
||||
@TableTitle(title = "当期收入额", dataIndex = "sre",key = "sre")
|
||||
private BigDecimal sre;
|
||||
/**
|
||||
* 当期免税收入 必填:否
|
||||
*/
|
||||
private BigDecimal mssd;
|
||||
/**
|
||||
* 基本养老保险 必填:否
|
||||
*/
|
||||
private BigDecimal jbylaobxf;
|
||||
/**
|
||||
* 基本医疗保险 必填:否
|
||||
*/
|
||||
private BigDecimal jbylbxf;
|
||||
/**
|
||||
* 失业保险 必填:否
|
||||
*/
|
||||
private BigDecimal sybxf;
|
||||
/**
|
||||
* 住房公积金 必填:否
|
||||
*/
|
||||
private BigDecimal zfgjj;
|
||||
/**
|
||||
* 子女教育支出 必填:否
|
||||
*/
|
||||
private BigDecimal znjyzc;
|
||||
/**
|
||||
* 赡养老人支出 必填:否
|
||||
*/
|
||||
private BigDecimal sylrzc;
|
||||
/**
|
||||
* 住房贷款利息支出 必填:否
|
||||
*/
|
||||
private BigDecimal zfdklxzc;
|
||||
/**
|
||||
* 住房租金支出 必填:否
|
||||
*/
|
||||
private BigDecimal zfzjzc;
|
||||
/**
|
||||
* 继续教育支出 必填:否
|
||||
*/
|
||||
private BigDecimal jxjyzc;
|
||||
/**
|
||||
* 非学历继续教育支出 必填:否
|
||||
*/
|
||||
private BigDecimal fxljxjyzc;
|
||||
/**
|
||||
* 3岁以下婴幼儿照护支出 必填:否
|
||||
*/
|
||||
private BigDecimal yyezhzc;
|
||||
/**
|
||||
* 年金 必填:否
|
||||
*/
|
||||
private BigDecimal nj;
|
||||
/**
|
||||
* 商业健康保险 必填:否
|
||||
*/
|
||||
private BigDecimal syjkbx;
|
||||
/**
|
||||
* 税延养老保险 必填:否
|
||||
*/
|
||||
private BigDecimal syylbx;
|
||||
/**
|
||||
* 其他 必填:否 按法律规定可以在税前扣除的项目
|
||||
*/
|
||||
private BigDecimal qt;
|
||||
/**
|
||||
* 准予扣除的捐赠额 必填:否
|
||||
*/
|
||||
private BigDecimal zykcjze;
|
||||
/**
|
||||
* 减免税额 必填:否
|
||||
*/
|
||||
private BigDecimal jmse;
|
||||
/**
|
||||
* 备注 必填:否
|
||||
*/
|
||||
private String bz;
|
||||
/**
|
||||
* 减除费用 必填:否 正常工资薪金的减除费用。 对应保险营销员、证券经纪人的费用
|
||||
*/
|
||||
private BigDecimal jcfy;
|
||||
/**
|
||||
* 其他扣除合计 必填:否
|
||||
*/
|
||||
private BigDecimal qtckhj;
|
||||
/**
|
||||
* 应纳税所得额 必填:否 正常工资薪金返回否
|
||||
*/
|
||||
@TableTitle(title = "应纳税所得额", dataIndex = "ynssde",key = "ynssde")
|
||||
private BigDecimal ynssde;
|
||||
/**
|
||||
* 应纳税额 必填:否 正常工资薪金返回否
|
||||
*/
|
||||
private BigDecimal ynse;
|
||||
/**
|
||||
* 已缴税额 必填:否 正常工资薪金返回否
|
||||
*/
|
||||
private BigDecimal ykjse;
|
||||
/**
|
||||
* 应扣缴税额 必填:否 正常工资薪金返回否
|
||||
*/
|
||||
private BigDecimal yingkjse;
|
||||
/**
|
||||
* 税率 必填:否
|
||||
*/
|
||||
private BigDecimal sl;
|
||||
/**
|
||||
* 速算扣除数 必填:否
|
||||
*/
|
||||
private BigDecimal sskcs;
|
||||
/**
|
||||
* 所得项目名称 必填:是 正常工资薪金;全年一次性奖金收入;稿酬所得;劳务报酬
|
||||
*/
|
||||
private String sdxm;
|
||||
/**
|
||||
* 应补退税额 必填:否 应补退税额=累计应扣缴税额-累计已缴税额
|
||||
*/
|
||||
@TableTitle(title = "应补退税额", dataIndex = "ybtse",key = "ybtse")
|
||||
private BigDecimal ybtse;
|
||||
/**
|
||||
* 累计收入额 必填:否
|
||||
*/
|
||||
private BigDecimal ljsre;
|
||||
/**
|
||||
* 累计免税收入额 必填:否
|
||||
*/
|
||||
private BigDecimal ljmssd;
|
||||
/**
|
||||
* 累计专项扣除额 必填:否 三险一金合计
|
||||
*/
|
||||
private BigDecimal ljzxkce;
|
||||
/**
|
||||
* 累计专项附加扣除额 必填:否 专项附加合计
|
||||
*/
|
||||
private BigDecimal ljzxfjkce;
|
||||
/**
|
||||
* 累计其他扣除额 必填:否
|
||||
*/
|
||||
private BigDecimal ljqtkce;
|
||||
/**
|
||||
* 累计减免税额 必填:否
|
||||
*/
|
||||
private BigDecimal ljjmse;
|
||||
/**
|
||||
* 累计减除费用额 必填:否 正常工资薪金累计减除费用 必填:否 对应保险营销员、证券经纪人累计费用
|
||||
*/
|
||||
private BigDecimal ljjcfye;
|
||||
/**
|
||||
* 累计月减除费用 必填:否 保险营销员、证券经纪人,其他连续劳务报酬的减除费用
|
||||
*/
|
||||
private BigDecimal ljyjcfy;
|
||||
/**
|
||||
* 允许扣除税费 必填:否 保险营销员、证券经纪人
|
||||
*/
|
||||
private BigDecimal yxkcsf;
|
||||
/**
|
||||
* 展业成本 必填:否 保险营销员、证券经纪人
|
||||
*/
|
||||
private BigDecimal zycb;
|
||||
/**
|
||||
* 月减除费用 必填:否 保险营销员、证券经纪人,其他连续劳务报酬的减除费用
|
||||
*/
|
||||
private BigDecimal yjcfy;
|
||||
/**
|
||||
* 累计应纳税所得额 必填:否
|
||||
*/
|
||||
@TableTitle(title = "累计应纳税所得额", dataIndex = "ljynssde",key = "ljynssde")
|
||||
private BigDecimal ljynssde;
|
||||
/**
|
||||
* 累计应纳税额 必填:否
|
||||
*/
|
||||
private BigDecimal ljynse;
|
||||
/**
|
||||
* 累计应扣缴税额 必填:否 累计应扣缴税额 = 累计应纳税额 - 累计减免税额
|
||||
*/
|
||||
private BigDecimal ljyingkjse;
|
||||
/**
|
||||
* 累计已缴税额 必填:否
|
||||
*/
|
||||
private BigDecimal ljykjse;
|
||||
/**
|
||||
* 累计子女教育支出 必填:否
|
||||
*/
|
||||
private BigDecimal ljznjyzc;
|
||||
/**
|
||||
* 累计继续教育支出 必填:否
|
||||
*/
|
||||
private BigDecimal ljjxjyzc;
|
||||
/**
|
||||
* 累计非学历继续教育支持 必填:否
|
||||
*/
|
||||
private BigDecimal ljfxljxjyzc;
|
||||
/**
|
||||
* 累计学历继续教育支持 必填:否
|
||||
*/
|
||||
private BigDecimal ljxljxjyzc;
|
||||
/**
|
||||
* 累计住房租金支出 必填:否
|
||||
*/
|
||||
private BigDecimal ljzfzjzc;
|
||||
/**
|
||||
* 累计房屋贷款支出 必填:否
|
||||
*/
|
||||
private BigDecimal ljzfdklxzc;
|
||||
/**
|
||||
* 累计赡养老人支出 必填:否
|
||||
*/
|
||||
private BigDecimal ljsylrzc;
|
||||
/**
|
||||
* 累计3岁以下婴幼儿照护支出 必填:否
|
||||
*/
|
||||
private BigDecimal ljyyezhzc;
|
||||
/**
|
||||
* 累计准予扣除的捐赠额 必填:否
|
||||
*/
|
||||
private BigDecimal ljzykcjze;
|
||||
/**
|
||||
* 累计个人养老金 必填:否
|
||||
*/
|
||||
private BigDecimal ljgrylj;
|
||||
/**
|
||||
* 累计个人养老金校验码 必填:否
|
||||
*/
|
||||
private String ljgryljjym;
|
||||
/**
|
||||
* 仅在两个月算税场景时使用,当前月分为N月:
|
||||
* 0表示N-1月(上月)未申报
|
||||
* 1表示N-1月(上月)已申报
|
||||
* 2表示N-2月(上上个月)未申报
|
||||
*/
|
||||
private String qysysfysb;
|
||||
|
||||
/**
|
||||
* 当前月分为N,如果N-1(上月)已申报,则返回N-1月员工在税局累计已扣缴的税额;
|
||||
* 如果N-1月未申报,则返回N-2月工在税局累计已扣缴的税额;
|
||||
*/
|
||||
private BigDecimal ygzsjljykjse;
|
||||
/**
|
||||
* 本月已累计扣除税额 必填:否 针对一月多次算税的场景字段
|
||||
*/
|
||||
private BigDecimal byyljkjse;
|
||||
/**
|
||||
* 本次应扣缴税额 必填:否 针对一月多次算税的场景字段,本次应扣缴税额=本月应扣缴税额-本月已累计税额
|
||||
*/
|
||||
private BigDecimal bcykjse;
|
||||
/**
|
||||
* 分摊年度数 必填:否
|
||||
*/
|
||||
private Integer ftnds;
|
||||
/**
|
||||
* 年减除费用 必填:否 默认为60000
|
||||
*/
|
||||
private BigDecimal njcfy;
|
||||
|
||||
|
||||
//----------非居民所得输出结果报文-------------------------------
|
||||
|
||||
/*
|
||||
* 姓名 必填:是
|
||||
*/
|
||||
// private String xm;
|
||||
/*
|
||||
* 证件类型名称 必填:是
|
||||
*/
|
||||
// private String zzlx;
|
||||
/*
|
||||
* 证件号码 必填:是
|
||||
*/
|
||||
// private String zzhm;
|
||||
/*
|
||||
* 收入额 必填:是
|
||||
*/
|
||||
// private String sre;
|
||||
/*
|
||||
* 累计收入(不含本次) 必填:是
|
||||
*/
|
||||
// private String ljsre;
|
||||
/*
|
||||
* 免税收入 必填:是
|
||||
*/
|
||||
// private String mssd;
|
||||
/**
|
||||
* 财产原值 必填:是
|
||||
*/
|
||||
private String ccyz;
|
||||
/*
|
||||
* 允许扣除的税费 必填:是
|
||||
*/
|
||||
// private String yxkcsf;
|
||||
/**
|
||||
* 投资抵扣 必填:是
|
||||
*/
|
||||
private String tzdk;
|
||||
/*
|
||||
* 其他 必填:是
|
||||
*/
|
||||
// private String qt;
|
||||
/*
|
||||
* 备注 必填:是
|
||||
*/
|
||||
// private String bz;
|
||||
/**
|
||||
* 实际工作年限 必填:是
|
||||
*/
|
||||
private String sjgznxs;
|
||||
/*
|
||||
* 减除费用 必填:是
|
||||
*/
|
||||
// private String jcfy;
|
||||
/*
|
||||
* 准予扣除的捐赠额 必填:是
|
||||
*/
|
||||
// private String zykcjze;
|
||||
/*
|
||||
* 税前扣除项目合计 必填:是
|
||||
*/
|
||||
// private String sqkcxmhj;
|
||||
/*
|
||||
* 应纳税额所得额 必填:是
|
||||
*/
|
||||
// private String ynssde;
|
||||
/*
|
||||
* 应纳税额 必填:是
|
||||
*/
|
||||
// private String ynse;
|
||||
/*
|
||||
* 减免税额 必填:是
|
||||
*/
|
||||
// private String jmse;
|
||||
/*
|
||||
* 应扣缴税额 必填:是
|
||||
*/
|
||||
// private String yingkjse;
|
||||
/*
|
||||
* 已扣缴税额 必填:是 无需填写该值,按0处理
|
||||
*/
|
||||
// private String ykjse;
|
||||
/*
|
||||
* 税率 必填:是
|
||||
*/
|
||||
// private String sl;
|
||||
/*
|
||||
* 速算扣除数 必填:是
|
||||
*/
|
||||
// private String sskcs;
|
||||
/**
|
||||
* 代报方式 必填:是
|
||||
*/
|
||||
private String sbfs;
|
||||
/*
|
||||
* 应补退税额 必填:是
|
||||
*/
|
||||
// private String ybtse;
|
||||
/*
|
||||
* 非居民所得项目名字 必填:是 非居民所得薪金类别-无住所个人正常工资薪金、全年一次性奖金收入
|
||||
*/
|
||||
// private String sdxm;
|
||||
/**
|
||||
* 所得期间起 必填:是 YYYY-MM
|
||||
*/
|
||||
private String sdqjq;
|
||||
/**
|
||||
* 所得期间止 必填:是 YYYY-MM
|
||||
*/
|
||||
private String sdqjz;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 算税失败原因对象
|
||||
*/
|
||||
@Data
|
||||
public static class sssbyy {
|
||||
/**
|
||||
* 人员ID
|
||||
*/
|
||||
private Integer ygid;
|
||||
/**
|
||||
* 人员名称
|
||||
*/
|
||||
private String xm;
|
||||
/**
|
||||
* 证件类型 见证件类型字典
|
||||
*/
|
||||
private String zzlx;
|
||||
/**
|
||||
* 证件号码
|
||||
*/
|
||||
private String zzhm;
|
||||
/**
|
||||
* 错误码
|
||||
*/
|
||||
private String cwm;
|
||||
/**
|
||||
* 错误信息
|
||||
*/
|
||||
private String cwxx;
|
||||
/**
|
||||
* 所得税的code
|
||||
*/
|
||||
private String sdxmdm;
|
||||
/**
|
||||
* 所得税的名称
|
||||
*/
|
||||
private String sdxmmc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO;
|
|||
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRateDTO;
|
||||
import com.engine.salary.entity.employeedeclare.param.*;
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
||||
import java.util.Collection;
|
||||
|
|
@ -109,6 +110,14 @@ public interface EmployeeDeclareService{
|
|||
*/
|
||||
PageInfo<EmployeeDeclarePO> listPage4FailByParam(EmployeeDeclareFailListQueryParam param);
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录关系的个税扣缴义务人查询报送人员
|
||||
*
|
||||
* @param salaryAcctTaxAgents
|
||||
* @return
|
||||
*/
|
||||
List<EmployeeDeclarePO> listBySalaryAcctTaxAgent(List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents);
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctCalcTaxReqPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SalaryAcctCalcTaxReqService {
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录查询
|
||||
*
|
||||
* @param salaryAcctRecordId
|
||||
* @return
|
||||
*/
|
||||
List<SalaryAcctCalcTaxReqPO> listByRecordId(Long salaryAcctRecordId);
|
||||
|
||||
/**
|
||||
* 批量保存
|
||||
*
|
||||
* @param salaryAcctCalcTaxReqs
|
||||
*/
|
||||
void batchSave(List<SalaryAcctCalcTaxReqPO> salaryAcctCalcTaxReqs);
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录删除
|
||||
*
|
||||
* @param salaryAcctRecordId
|
||||
*/
|
||||
void deleteByRecordId(Long salaryAcctRecordId);
|
||||
}
|
||||
|
|
@ -116,6 +116,7 @@ public interface SalaryAcctResultService {
|
|||
* @param salaryAcctResultPOS 薪资核算结果
|
||||
*/
|
||||
void batchSave(List<SalaryAcctResultPO> salaryAcctResultPOS);
|
||||
void batchUpdate(List<SalaryAcctResultPO> salaryAcctResultPOS);
|
||||
|
||||
/**
|
||||
* 根据薪资核算人员id删除薪资核算结果
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryCalcTaxInfoDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryCalcTaxParam;
|
||||
|
||||
public interface SalaryCalcTaxService {
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录id获取在线计算个税的相关信息
|
||||
*
|
||||
* @param salaryCalcTaxParam
|
||||
* @return
|
||||
*/
|
||||
SalaryCalcTaxInfoDTO getCalcTaxInfo(SalaryCalcTaxParam salaryCalcTaxParam);
|
||||
|
||||
/**
|
||||
* 计算个税
|
||||
*
|
||||
* @param salaryCalcTaxParam
|
||||
*/
|
||||
void calcTax(SalaryCalcTaxParam salaryCalcTaxParam);
|
||||
|
||||
/**
|
||||
* 计算个税获取反馈
|
||||
*
|
||||
* @param salaryCalcTaxParam
|
||||
*/
|
||||
void calcTaxFeedback(SalaryCalcTaxParam salaryCalcTaxParam);
|
||||
}
|
||||
|
|
@ -20,6 +20,7 @@ import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
|||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO;
|
||||
import com.engine.salary.entity.employeedeclare.response.DeclareEmployeeFeedbackResponse;
|
||||
import com.engine.salary.entity.employeedeclare.response.DeclareEmployeeInfoResponse;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctTaxAgentPO;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO;
|
||||
|
|
@ -188,6 +189,24 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
|
|||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EmployeeDeclarePO> listBySalaryAcctTaxAgent(List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents) {
|
||||
if (CollectionUtils.isEmpty(salaryAcctTaxAgents)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Map<String, SalaryAcctTaxAgentPO> employeeDeclareParamMap = new HashMap<>();
|
||||
for (SalaryAcctTaxAgentPO po : salaryAcctTaxAgents) {
|
||||
employeeDeclareParamMap.putIfAbsent(po.getTaxAgentId() + "-" + po.getTaxCycle(), po);
|
||||
}
|
||||
List<EmployeeDeclarePO> employeeDeclares = new ArrayList<>();
|
||||
for (Map.Entry<String, SalaryAcctTaxAgentPO> entry : employeeDeclareParamMap.entrySet()) {
|
||||
SalaryAcctTaxAgentPO salaryAcctTaxAgent = entry.getValue();
|
||||
List<EmployeeDeclarePO> temp = listByTaxCycleAndTaxAgentId(salaryAcctTaxAgent.getTaxCycle(), salaryAcctTaxAgent.getTaxAgentId());
|
||||
employeeDeclares.addAll(temp);
|
||||
}
|
||||
return employeeDeclares;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(EmployeeDeclareSaveParam saveParam) {
|
||||
Date now = new Date();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctCalcTaxReqPO;
|
||||
import com.engine.salary.mapper.salaryacct.SalaryAcctCalcTaxReqMapper;
|
||||
import com.engine.salary.service.SalaryAcctCalcTaxReqService;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SalaryAcctCalcTaxReqServiceImpl extends Service implements SalaryAcctCalcTaxReqService {
|
||||
|
||||
private SalaryAcctCalcTaxReqMapper getSalaryAcctCalcTaxReqMapper() {
|
||||
return MapperProxyFactory.getProxy(SalaryAcctCalcTaxReqMapper.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SalaryAcctCalcTaxReqPO> listByRecordId(Long salaryAcctRecordId) {
|
||||
return getSalaryAcctCalcTaxReqMapper().listSome(SalaryAcctCalcTaxReqPO.builder().salaryAcctRecordId(salaryAcctRecordId).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void batchSave(List<SalaryAcctCalcTaxReqPO> salaryAcctCalcTaxReqs) {
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctCalcTaxReqs)) {
|
||||
salaryAcctCalcTaxReqs.forEach(getSalaryAcctCalcTaxReqMapper()::insertIgnoreNull);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByRecordId(Long salaryAcctRecordId) {
|
||||
getSalaryAcctCalcTaxReqMapper().deleteByRecordId(salaryAcctRecordId);
|
||||
}
|
||||
}
|
||||
|
|
@ -704,6 +704,15 @@ public class SalaryAcctResultServiceImpl extends Service implements SalaryAcctRe
|
|||
}
|
||||
}
|
||||
|
||||
public void batchUpdate(List<SalaryAcctResultPO> salaryAcctResultPOS) {
|
||||
if (CollectionUtils.isNotEmpty(salaryAcctResultPOS)) {
|
||||
// 数据加密
|
||||
encryptUtil.encryptList(salaryAcctResultPOS, SalaryAcctResultPO.class);
|
||||
List<List<SalaryAcctResultPO>> partition = Lists.partition(salaryAcctResultPOS, 100);
|
||||
partition.forEach(getSalaryAcctResultMapper()::batchUpdate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void deleteBySalaryAcctEmployeeIds(Collection<Long> salaryAcctEmployeeIds) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,315 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.constant.SzyhApiConstant;
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryCalcTax;
|
||||
import com.engine.salary.entity.salaryacct.bo.SalaryCalcTaxFeedback;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryCalcTaxInfoDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryCalcTaxParam;
|
||||
import com.engine.salary.entity.salaryacct.po.*;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobTaxReportRulePO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO;
|
||||
import com.engine.salary.entity.taxdeclaration.response.DeclareTaxResponse;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.remote.tax.client.CalculateClient;
|
||||
import com.engine.salary.remote.tax.response.calculate.GetASynIndividualIncomeTaxFeedbackResponse;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.*;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
public class SalaryCalcTaxServiceImpl extends Service implements SalaryCalcTaxService {
|
||||
|
||||
|
||||
private SalaryAcctRecordService getSalaryAcctRecordService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctRecordServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctTaxAgentService getSalaryAcctTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctTaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctEmployeeService getSalaryAcctEmployeeService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctEmployeeServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentService getTaxAgentService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxReportColumnService getTaxReportColumnService(User user) {
|
||||
return ServiceUtil.getService(TaxReportColumnServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobTaxReportRuleService getSalarySobTaxReportRuleService(User user) {
|
||||
return ServiceUtil.getService(SalarySobTaxReportRuleServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private EmployeeDeclareService getEmployeeDeclareService(User user) {
|
||||
return ServiceUtil.getService(EmployeeDeclareServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) {
|
||||
return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctCalcTaxReqService getSalaryAcctCalcTaxReqService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctCalcTaxReqServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryAcctResultService getSalaryAcctResultService(User user) {
|
||||
return ServiceUtil.getService(SalaryAcctResultServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SalaryCalcTaxInfoDTO getCalcTaxInfo(SalaryCalcTaxParam salaryCalcTaxParam) {
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(salaryCalcTaxParam.getSalaryAcctRecordId());
|
||||
// 查询供应商信息
|
||||
TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(false);
|
||||
// 查询在线计算个税记录
|
||||
List<SalaryAcctCalcTaxReqPO> salaryAcctCalcTaxReqs = getSalaryAcctCalcTaxReqService(user).listByRecordId(salaryAcctRecord.getId());
|
||||
|
||||
boolean enableTaxDeclarationApiConfig = Objects.nonNull(apiConfig) && Objects.equals(apiConfig.getEnableUse(), 1);
|
||||
boolean showCalcTaxButton = enableTaxDeclarationApiConfig && CollectionUtils.isEmpty(salaryAcctCalcTaxReqs);
|
||||
boolean showCalcTaxFeedbackButton = enableTaxDeclarationApiConfig && CollectionUtils.isNotEmpty(salaryAcctCalcTaxReqs);
|
||||
|
||||
SalaryCalcTaxInfoDTO salaryCalcTaxInfo = new SalaryCalcTaxInfoDTO();
|
||||
salaryCalcTaxInfo.setEnableTaxDeclarationApiConfig(enableTaxDeclarationApiConfig);
|
||||
salaryCalcTaxInfo.setShowCalcTaxButton(showCalcTaxButton);
|
||||
salaryCalcTaxInfo.setShowCalcTaxFeedbackButton(showCalcTaxFeedbackButton);
|
||||
|
||||
return salaryCalcTaxInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcTax(SalaryCalcTaxParam salaryCalcTaxParam) {
|
||||
// 查询供应商信息
|
||||
TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true);
|
||||
if (apiConfig == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160525, "接口流量不足,暂无法使用该功能,请先购买智能算薪接口流量"));
|
||||
}
|
||||
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(salaryCalcTaxParam.getSalaryAcctRecordId());
|
||||
// 查询薪资核算记录关联的个税扣缴义务人
|
||||
List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents = getSalaryAcctTaxAgentService(user)
|
||||
.listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecord.getId()));
|
||||
// 查询薪资核算记录关联的薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecord.getId());
|
||||
// 查询薪资核算记录关联的薪资核算结果
|
||||
List<SalaryAcctResultPO> salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecord.getId()));
|
||||
// 查询个税扣缴义务人
|
||||
Set<Long> taxAgentIds = SalaryEntityUtil.properties(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId);
|
||||
List<TaxAgentPO> taxAgents = getTaxAgentService(user).listByIds(taxAgentIds);
|
||||
// 查询个税扣缴义务人关联的报税信息
|
||||
List<TaxAgentTaxReturnPO> taxAgentTaxReturns = getTaxAgentTaxReturnService(user).getByTaxAgentIds(taxAgentIds);
|
||||
// 查询个税申报表字段
|
||||
List<TaxReportColumnPO> taxReportColumns = getTaxReportColumnService(user).listAll();
|
||||
// 查询薪资核算记录关联薪资账套的个税申报配置
|
||||
List<SalarySobTaxReportRulePO> salarySobTaxReportRules = getSalarySobTaxReportRuleService(user)
|
||||
.listBySalarySobIds(Collections.singleton(salaryAcctRecord.getSalarySobId()));
|
||||
// 查询报送人员
|
||||
List<EmployeeDeclarePO> employeeDeclares = getEmployeeDeclareService(user).listBySalaryAcctTaxAgent(salaryAcctTaxAgents);
|
||||
|
||||
List<SalaryAcctCalcTaxReqPO> salaryAcctCalcTaxReqs = new ArrayList<>();
|
||||
|
||||
Date now = new Date();
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
String url = apiConfig.getHost() + SzyhApiConstant.CALCULATE_ASYN_INDIVIDUAL_INCOME_TAX;
|
||||
SalaryCalcTax salaryCalcTax = new SalaryCalcTax(salaryAcctRecord, salaryAcctTaxAgents, salaryAcctEmployees,
|
||||
salaryAcctResultValues, taxAgents, taxAgentTaxReturns, taxReportColumns, salarySobTaxReportRules, employeeDeclares);
|
||||
Map<Long, Map<String, Object>> taxAgentIdKeyRequestParam = salaryCalcTax.buildCalcTaxRequestParam();
|
||||
for (Map.Entry<Long, Map<String, Object>> entry : taxAgentIdKeyRequestParam.entrySet()) {
|
||||
String reqJson = JsonUtil.toJsonString(entry.getValue());
|
||||
// 请求第三方供应商
|
||||
String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
||||
|
||||
DeclareTaxResponse declareTaxResponse = JsonUtil.parseObject(res, DeclareTaxResponse.class);
|
||||
if (Objects.isNull(declareTaxResponse) || Objects.isNull(declareTaxResponse.getHead())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常"));
|
||||
}
|
||||
if (!Objects.equals(declareTaxResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
|
||||
throw new SalaryRunTimeException(declareTaxResponse.getHead().getMsg());
|
||||
}
|
||||
|
||||
SalaryAcctCalcTaxReqPO salaryAcctCalcTaxReq = new SalaryAcctCalcTaxReqPO();
|
||||
salaryAcctCalcTaxReq.setId(IdGenerator.generate());
|
||||
salaryAcctCalcTaxReq.setSalaryAcctRecordId(salaryAcctRecord.getId());
|
||||
salaryAcctCalcTaxReq.setTaxAgentId(entry.getKey());
|
||||
salaryAcctCalcTaxReq.setRequestId(declareTaxResponse.getBody().getRequestId());
|
||||
salaryAcctCalcTaxReq.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
|
||||
salaryAcctCalcTaxReq.setCreator((long) user.getUID());
|
||||
salaryAcctCalcTaxReq.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue());
|
||||
salaryAcctCalcTaxReq.setCreateTime(now);
|
||||
salaryAcctCalcTaxReq.setUpdateTime(now);
|
||||
salaryAcctCalcTaxReqs.add(salaryAcctCalcTaxReq);
|
||||
}
|
||||
|
||||
// 批量保存
|
||||
getSalaryAcctCalcTaxReqService(user).batchSave(salaryAcctCalcTaxReqs);
|
||||
// 记录日志
|
||||
String operateTypeName = SalaryI18nUtil.getI18nLabel(268191, "在线计算个税");
|
||||
// 记录日志
|
||||
// getSalaryAcctResultService(user).writeBatchLog(salaryAcctRecord, Collections.emptyMap(), SalaryLogOperateTypeEnum.CALC_TAX_ONLINE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calcTaxFeedback(SalaryCalcTaxParam salaryCalcTaxParam) {
|
||||
// 查询供应商信息
|
||||
TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true);
|
||||
if (apiConfig == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(160525, "接口流量不足,暂无法使用该功能,请先购买智能算薪接口流量"));
|
||||
}
|
||||
// 查询薪资核算记录
|
||||
SalaryAcctRecordPO salaryAcctRecord = getSalaryAcctRecordService(user).getById(salaryCalcTaxParam.getSalaryAcctRecordId());
|
||||
// 查询薪资核算记录关联的薪资核算人员
|
||||
List<SalaryAcctEmployeePO> salaryAcctEmployees = getSalaryAcctEmployeeService(user).listBySalaryAcctRecordId(salaryAcctRecord.getId());
|
||||
Map<String, List<SalaryAcctEmployeePO>> salaryAcctEmployeeMap = SalaryEntityUtil.group2Map(salaryAcctEmployees, e -> e.getTaxAgentId() + "-" + e.getIncomeCategory());
|
||||
// 查询薪资核算记录关联的薪资核算结果
|
||||
List<SalaryAcctResultPO> salaryAcctResultValues = getSalaryAcctResultService(user).listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecord.getId()));
|
||||
Map<Long, Map<Long, SalaryAcctResultPO>> salaryAcctResultValueMap = SalaryEntityUtil.list2Map(salaryAcctResultValues, SalaryAcctResultPO::getSalaryAcctEmpId, SalaryAcctResultPO::getSalaryItemId);
|
||||
// 查询薪资核算记录关联的个税扣缴义务人
|
||||
List<SalaryAcctTaxAgentPO> salaryAcctTaxAgents = getSalaryAcctTaxAgentService(user)
|
||||
.listBySalaryAcctRecordIds(Collections.singleton(salaryAcctRecord.getId()));
|
||||
Map<Long, List<SalaryAcctTaxAgentPO>> salaryAcctTaxAgentMap = SalaryEntityUtil.group2Map(salaryAcctTaxAgents, SalaryAcctTaxAgentPO::getTaxAgentId);
|
||||
// 查询薪资核算记录关联的异步算税请求记录
|
||||
List<SalaryAcctCalcTaxReqPO> salaryAcctCalcTaxReqs = getSalaryAcctCalcTaxReqService(user).listByRecordId(salaryAcctRecord.getId());
|
||||
if (CollectionUtils.isEmpty(salaryAcctCalcTaxReqs)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(268184, "请先计算个税再获取反馈"));
|
||||
}
|
||||
// 查询薪资核算记录关联的薪资账套个税申报表字段对应
|
||||
List<SalarySobTaxReportRulePO> salarySobTaxReportRules = getSalarySobTaxReportRuleService(user).listBySalarySobIds(Collections.singleton(salaryAcctRecord.getSalarySobId()));
|
||||
Map<String, SalarySobTaxReportRulePO> salarySobTaxReportRuleMap = SalaryEntityUtil.convert2Map(salarySobTaxReportRules, SalarySobTaxReportRulePO::getReportColumnDataIndex);
|
||||
// 查询报送人员
|
||||
List<EmployeeDeclarePO> employeeDeclares = getEmployeeDeclareService(user).listBySalaryAcctTaxAgent(salaryAcctTaxAgents);
|
||||
Map<Long, List<EmployeeDeclarePO>> employeeDeclareMap = SalaryEntityUtil.group2Map(employeeDeclares, EmployeeDeclarePO::getTaxAgentId);
|
||||
|
||||
String url = apiConfig.getHost() + SzyhApiConstant.ASYN_INDIVIDUAL_INCOME_TAX_FEEDBACK;
|
||||
Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
|
||||
List<SalaryAcctResultPO> resultPOS = new ArrayList<>();
|
||||
for (SalaryAcctCalcTaxReqPO salaryAcctCalcTaxReq : salaryAcctCalcTaxReqs) {
|
||||
CalculateClient calculateClient = new CalculateClient(salaryAcctCalcTaxReq.getTaxAgentId());
|
||||
GetASynIndividualIncomeTaxFeedbackResponse feedbackResponse = calculateClient.getASynIndividualIncomeTaxFeedback(salaryAcctCalcTaxReq.getRequestId());
|
||||
|
||||
if (Objects.isNull(feedbackResponse) || Objects.isNull(feedbackResponse.getHead())) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常"));
|
||||
}
|
||||
if (!Objects.equals(feedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
|
||||
throw new SalaryRunTimeException(feedbackResponse.getHead().getMsg());
|
||||
}
|
||||
List<SalaryAcctTaxAgentPO> subSalaryAcctTaxAgents = salaryAcctTaxAgentMap.get(salaryAcctCalcTaxReq.getTaxAgentId());
|
||||
if (CollectionUtils.isEmpty(subSalaryAcctTaxAgents)) {
|
||||
continue;
|
||||
}
|
||||
List<EmployeeDeclarePO> subEmployeeDeclares = employeeDeclareMap.get(salaryAcctCalcTaxReq.getTaxAgentId());
|
||||
|
||||
// 获取不同所得项目的个税
|
||||
for (SalaryAcctTaxAgentPO salaryAcctTaxAgent : subSalaryAcctTaxAgents) {
|
||||
IncomeCategoryEnum incomeCategoryEnum = IncomeCategoryEnum.parseByValue(salaryAcctTaxAgent.getIncomeCategory());
|
||||
if (incomeCategoryEnum == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Map<Long, GetASynIndividualIncomeTaxFeedbackResponse.Body.result> empIdResult = incomeCategoryEnum.parseGetASynIndividualIncomeTaxFeedbackResponse(feedbackResponse, subEmployeeDeclares);
|
||||
|
||||
|
||||
Map<String, Object> dataMap = null;
|
||||
// switch (incomeCategoryEnum) {
|
||||
// case WAGES_AND_SALARIES:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("zcgzxj"), Object.class);
|
||||
// break;
|
||||
// case ONETIME_ANNUAL_BONUS:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("qnycxjjsslb"), Object.class);
|
||||
// break;
|
||||
// case COMPENSATION_FOR_RETIRE:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("ntycxbcjlb"), Object.class);
|
||||
// break;
|
||||
// case COMPENSATION_FOR_DISMISS:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("jcldhtycxbcjlb"), Object.class);
|
||||
// break;
|
||||
// case INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("grgqjl"), Object.class);
|
||||
// break;
|
||||
// case ANNUITY_RECEIPT:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("qynj"), Object.class);
|
||||
// break;
|
||||
// case REMUNERATION_FOR_LABOR:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("lwbclb"), Object.class);
|
||||
// break;
|
||||
// case INCOME_FOR_INSURANCE_SALESMAN:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("bxyxy"), Object.class);
|
||||
// break;
|
||||
// case INCOME_FOR_SECURITIES_BROKER:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("zqjjr"), Object.class);
|
||||
// break;
|
||||
// case REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("qtlxlwbc"), Object.class);
|
||||
// break;
|
||||
// case REMUNERATION_FOR_OTHER_LABOR:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("qtflxlwbc"), Object.class);
|
||||
// break;
|
||||
// case REMUNERATION_FOR_AUTHOR:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("gcsdlb"), Object.class);
|
||||
// break;
|
||||
// case ROYALTIES:
|
||||
// dataMap = JsonUtil.parseMap(ZHSDMap.get("txq"), Object.class);
|
||||
// break;
|
||||
// default:
|
||||
// dataMap = Collections.emptyMap();
|
||||
// break;
|
||||
// }
|
||||
|
||||
Map<Long, String> employeeIdKeyTaxMap;
|
||||
SalaryCalcTaxFeedback salaryCalcTaxFeedback = new SalaryCalcTaxFeedback(dataMap, subEmployeeDeclares);
|
||||
if (incomeCategoryEnum == IncomeCategoryEnum.WAGES_AND_SALARIES) {
|
||||
employeeIdKeyTaxMap = salaryCalcTaxFeedback.buildZCGZXJFeedback();
|
||||
} else {
|
||||
employeeIdKeyTaxMap = salaryCalcTaxFeedback.buildOtherFeedback();
|
||||
}
|
||||
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
List<SalaryAcctEmployeePO> subSalaryAcctEmployees = salaryAcctEmployeeMap.get(salaryAcctTaxAgent.getTaxAgentId() + "-" + salaryAcctTaxAgent.getIncomeCategory());
|
||||
if (CollectionUtils.isEmpty(subSalaryAcctEmployees)) {
|
||||
continue;
|
||||
}
|
||||
for (SalaryAcctEmployeePO salaryAcctEmployee : subSalaryAcctEmployees) {
|
||||
Map<Long, SalaryAcctResultPO> salaryAcctResultValue = salaryAcctResultValueMap.get(salaryAcctEmployee.getId());
|
||||
if (salaryAcctResultValue == null) {
|
||||
continue;
|
||||
}
|
||||
SalarySobTaxReportRulePO salarySobTaxReportRule = salarySobTaxReportRuleMap.get("refundedOrSupplementedTax" + salaryAcctEmployee.getIncomeCategory());
|
||||
if (salarySobTaxReportRule != null) {
|
||||
SalaryAcctResultPO salaryAcctResultPO = salaryAcctResultValue.get(salarySobTaxReportRule.getSalaryItemId());
|
||||
salaryAcctResultPO.setResultValue(employeeIdKeyTaxMap.get(salaryAcctEmployee.getEmployeeId()));
|
||||
resultPOS.add(salaryAcctResultPO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getSalaryAcctResultService(user).batchUpdate(resultPOS);
|
||||
getSalaryAcctCalcTaxReqService(user).deleteByRecordId(salaryAcctRecord.getId());
|
||||
// 记录日志
|
||||
// getSalaryAcctResultService(user).writeBatchLog(salaryAcctRecord, Collections.emptyMap(), SalaryLogOperateTypeEnum.GET_CALC_TAX_FEEDBACK);
|
||||
}
|
||||
}
|
||||
|
|
@ -163,6 +163,36 @@ public class SalaryEntityUtil {
|
|||
Collectors.collectingAndThen(Collectors.toList(), e -> e.stream().map(valueMapper).collect(Collectors.toList()))));
|
||||
}
|
||||
|
||||
public static <R, T, K, V> Map<R, Map<K, V>> list2Map(Collection<T> objs, Function<T, R> function1, Function<T, K> function2, Function<T, V> function3) {
|
||||
if (CollectionUtils.isEmpty(objs)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
Map<R, List<T>> collect = objs.stream().collect(Collectors.groupingBy(function1));
|
||||
Map<R, Map<K, V>> map = new HashMap<>();
|
||||
for (Map.Entry<R, List<T>> entry: collect.entrySet()) {
|
||||
Map<K, V> values = map.getOrDefault(entry.getKey(), new HashMap<>());
|
||||
entry.getValue().forEach(e -> values.put(function2.apply(e), function3.apply(e)));
|
||||
map.put(entry.getKey(), values);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
public static <R, T, K> Map<R, Map<K, T>> list2Map(Collection<T> objs, Function<T, R> function1, Function<T, K> function2) {
|
||||
if (CollectionUtils.isEmpty(objs)) {
|
||||
return Maps.newHashMap();
|
||||
}
|
||||
Map<R, List<T>> collect = objs.stream().collect(Collectors.groupingBy(function1));
|
||||
Map<R, Map<K, T>> map = new HashMap<>();
|
||||
for (Map.Entry<R, List<T>> entry: collect.entrySet()) {
|
||||
Map<K, T> values = map.getOrDefault(entry.getKey(), new HashMap<>());
|
||||
entry.getValue().forEach(e -> values.put(function2.apply(e), e));
|
||||
map.put(entry.getKey(), values);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* LinkedHashMap有序去重
|
||||
*
|
||||
|
|
@ -211,9 +241,10 @@ public class SalaryEntityUtil {
|
|||
|
||||
/**
|
||||
* 进位规则
|
||||
* @param newScale 小数位
|
||||
*
|
||||
* @param newScale 小数位
|
||||
* @param rententionRule 进位规则
|
||||
* @param value 值
|
||||
* @param value 值
|
||||
* @return
|
||||
*/
|
||||
public static BigDecimal carryRule(Integer newScale, Integer rententionRule, BigDecimal value) {
|
||||
|
|
@ -374,7 +405,6 @@ public class SalaryEntityUtil {
|
|||
}
|
||||
|
||||
|
||||
|
||||
public static String null2String(Object obj) {
|
||||
if (Objects.isNull(obj)) {
|
||||
return "";
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.engine.salary.util.ResponseResult;
|
|||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.*;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -494,6 +495,33 @@ public class SalaryAcctController {
|
|||
return new ResponseResult<SalaryAcctCalculateParam, String>(user).run(getSalaryAcctResultWrapper(user)::calculate, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/acctresult/getCalcTaxInfo")
|
||||
@ApiOperation("获取「计算个税」和「获取个税计算反馈」反馈的显示与否")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getCalcTaxInfo(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody SalaryCalcTaxParam salaryCalcTaxParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryCalcTaxParam, SalaryCalcTaxInfoDTO>(user).run(getSalaryAcctResultWrapper(user)::getCalcTaxInfo, salaryCalcTaxParam);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/acctresult/calcTax")
|
||||
@ApiOperation("计算个税")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String calcTax(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody SalaryCalcTaxParam salaryCalcTaxParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryCalcTaxParam, SalaryCalcTaxInfoDTO>(user).run(getSalaryAcctResultWrapper(user)::calcTax, salaryCalcTaxParam);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/acctresult/calcTaxFeedback")
|
||||
@ApiOperation("获取个税计算反馈")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String calcTaxFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody SalaryCalcTaxParam salaryCalcTaxParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<SalaryCalcTaxParam, SalaryCalcTaxInfoDTO>(user).run(getSalaryAcctResultWrapper(user)::calcTaxFeedback, salaryCalcTaxParam);
|
||||
}
|
||||
|
||||
//导出核算结果
|
||||
@GET
|
||||
@Path("/acctresult/export")
|
||||
|
|
@ -692,7 +720,7 @@ public class SalaryAcctController {
|
|||
|
||||
// @GetMapping("/checkresult/getCount")
|
||||
// @ApiOperation(("获取校验结果(异常)总数"))
|
||||
// @WeaPermission
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public WeaResult<Integer> getCheckResultCount(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) {
|
||||
// Integer salaryCheckResultCount = salaryAcctCheckResultWrapper.countBySalaryAcctRecordId(salaryAcctRecordId, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(salaryCheckResultCount);
|
||||
|
|
@ -700,7 +728,7 @@ public class SalaryAcctController {
|
|||
//
|
||||
// @PostMapping("/checkresult/list")
|
||||
// @ApiOperation("校验结果列表")
|
||||
// @WeaPermission
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public WeaResult<WeaTable<SalaryCheckResultListDTO>> listCheckResult(@RequestBody @Validated SalaryCheckResultQueryParam queryParam) {
|
||||
// WeaTable<SalaryCheckResultListDTO> weaTable = salaryAcctCheckResultWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(weaTable);
|
||||
|
|
@ -708,7 +736,7 @@ public class SalaryAcctController {
|
|||
//
|
||||
// @PostMapping("/checkresultdetail/list")
|
||||
// @ApiOperation("校验结果明细列表")
|
||||
// @WeaPermission
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public WeaResult<WeaTable<SalaryCheckResultRecordListDTO>> listCheckResultRecord(@RequestBody @Validated SalaryCheckResultRecordQueryParam queryParam) {
|
||||
// WeaTable<SalaryCheckResultRecordListDTO> weaTable = salaryAcctCheckResultWrapper.listPage4CheckResultRecord(queryParam, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(weaTable);
|
||||
|
|
@ -716,7 +744,7 @@ public class SalaryAcctController {
|
|||
//
|
||||
// @PostMapping("/checkresult/ignore")
|
||||
// @ApiOperation("校验结果列表")
|
||||
// @WeaPermission
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public WeaResult<Object> ignoreCheckResult(@RequestParam(value = "id") Long id) {
|
||||
// salaryAcctCheckResultWrapper.ignoreById(id, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(null);
|
||||
|
|
@ -724,7 +752,7 @@ public class SalaryAcctController {
|
|||
//
|
||||
// @PostMapping("/checkresult/ignoreAll")
|
||||
// @ApiOperation("校验结果列表")
|
||||
// @WeaPermission
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public WeaResult<Object> ignoreAllCheckResult(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) {
|
||||
// salaryAcctCheckResultWrapper.ignoreBySalaryAcctRecordId(salaryAcctRecordId, TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(null);
|
||||
|
|
@ -732,7 +760,7 @@ public class SalaryAcctController {
|
|||
//
|
||||
// @PostMapping("/acctresult/check")
|
||||
// @ApiOperation(("薪资核算结果校验"))
|
||||
// @WeaPermission
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public WeaResult<Object> check(@RequestBody @Validated SalaryAcctCheckParam checkParam) {
|
||||
// salaryAcctResultWrapper.check(checkParam, UserContext.getCurrentUser(), TenantContext.getCurrentTenantKey());
|
||||
// return WeaResult.success(null);
|
||||
|
|
@ -740,7 +768,7 @@ public class SalaryAcctController {
|
|||
//
|
||||
// @PostMapping("/checkresult/export")
|
||||
// @ApiOperation("校验异常导出")
|
||||
// @WeaPermission
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public WeaResult<Map<String, Object>> exportCheckResult(@RequestBody @Validated SalaryCheckResultExportParam exportParam) {
|
||||
// DataCollectionEmployee simpleEmployee = UserContext.getCurrentUser();
|
||||
// String tenantKey = TenantContext.getCurrentTenantKey();
|
||||
|
|
@ -751,7 +779,7 @@ public class SalaryAcctController {
|
|||
//
|
||||
// @PostMapping("/checkresultRecord/export")
|
||||
// @ApiOperation("校验异常明细导出")
|
||||
// @WeaPermission
|
||||
// @Produces(MediaType.APPLICATION_JSON)
|
||||
// public WeaResult<Map<String, Object>> exportCheckResultDetail(@RequestParam(value = "checkResultId") Long checkResultId) {
|
||||
// DataCollectionEmployee simpleEmployee = UserContext.getCurrentUser();
|
||||
// String tenantKey = TenantContext.getCurrentTenantKey();
|
||||
|
|
|
|||
|
|
@ -103,6 +103,13 @@ public class SalarySobController {
|
|||
return new ResponseResult<SalarySobListQueryParam, List<SalarySobPO>>(user).run(getSalarySobWrapper(user)::listAll);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/incomeCategoryList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getSalarySobBasicForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, List<Map<String, Object>>>(user).run(getSalarySobWrapper(user)::incomeCategoryList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资账套基本信息表单
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.engine.salary.entity.progress.ProgressDTO;
|
|||
import com.engine.salary.entity.salaryacct.dto.ConsolidatedTaxDetailDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultDetailDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryAcctResultListColumnDTO;
|
||||
import com.engine.salary.entity.salaryacct.dto.SalaryCalcTaxInfoDTO;
|
||||
import com.engine.salary.entity.salaryacct.param.*;
|
||||
import com.engine.salary.entity.salaryacct.po.SalaryAcctRecordPO;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
|
|
@ -75,6 +76,10 @@ public class SalaryAcctResultWrapper extends Service implements SalaryAcctResult
|
|||
return ServiceUtil.getService(SalarySysConfServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryCalcTaxService getSalaryCalcTaxService(User user) {
|
||||
return ServiceUtil.getService(SalaryCalcTaxServiceImpl.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪资核算列表
|
||||
*
|
||||
|
|
@ -298,4 +303,32 @@ public class SalaryAcctResultWrapper extends Service implements SalaryAcctResult
|
|||
// };
|
||||
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "salaryAcctCheck", localRunnable);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 根据薪资核算记录id获取在线计算个税的相关信息
|
||||
*
|
||||
* @param salaryCalcTaxParam
|
||||
* @return
|
||||
*/
|
||||
public SalaryCalcTaxInfoDTO getCalcTaxInfo(SalaryCalcTaxParam salaryCalcTaxParam) {
|
||||
return getSalaryCalcTaxService(user).getCalcTaxInfo(salaryCalcTaxParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算个税
|
||||
*
|
||||
* @param salaryCalcTaxParam
|
||||
*/
|
||||
public void calcTax(SalaryCalcTaxParam salaryCalcTaxParam) {
|
||||
getSalaryCalcTaxService(user).calcTax(salaryCalcTaxParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算个税获取反馈
|
||||
*
|
||||
* @param salaryCalcTaxParam
|
||||
*/
|
||||
public void calcTaxFeedback(SalaryCalcTaxParam salaryCalcTaxParam) {
|
||||
getSalaryCalcTaxService(user).calcTaxFeedback(salaryCalcTaxParam);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -269,4 +269,18 @@ public class SalarySobWrapper extends Service {
|
|||
return taxAgentIds.contains(salarySobPO.getTaxAgentId()) || Objects.isNull(salarySobPO.getTaxAgentId());
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> incomeCategoryList() {
|
||||
IncomeCategoryEnum[] values = IncomeCategoryEnum.values();
|
||||
List<Map<String, Object>> list = new ArrayList<>(values.length);
|
||||
for (IncomeCategoryEnum value : values) {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("enum", value);
|
||||
map.put("value", value.getValue());
|
||||
map.put("defaultLabel", value.getDefaultLabel());
|
||||
map.put("labelId", value.getLabelId());
|
||||
map.put("reportTypeName", value.getReportType().getDefaultLabel());
|
||||
list.add(map);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ import java.util.List;
|
|||
|
||||
public class ParseTaxApi {
|
||||
public static void main(String[] args) {
|
||||
readExcel("H:\\code\\salary\\test\\ApiDes.xlsx");
|
||||
// readExcel("H:\\code\\salary\\test\\ApiDes.xlsx");
|
||||
|
||||
// readExcel2("H:\\code\\salary\\test\\ApiDes.xlsx");
|
||||
readExcel2("H:\\code\\salary\\test\\ApiDes.xlsx");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue