申报内置算税结果查询(下架)

This commit is contained in:
钱涛 2024-06-24 16:52:42 +08:00
parent 90a198bb54
commit bae85b761c
8 changed files with 4 additions and 513 deletions

View File

@ -4,9 +4,7 @@ import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
import com.engine.salary.entity.salarysob.dto.SalarySobTaxRuleDTO;
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 com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j;
@ -31,13 +29,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
// todo 多语言
WAGES_AND_SALARIES(1, "0101", "正常工资薪金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160487) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -67,13 +58,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
}
},
REMUNERATION_FOR_LABOR(4, "0400", "一般劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160488) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -104,13 +88,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
ONETIME_ANNUAL_BONUS(2, "0103", "全年一次性奖金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 160489) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -141,13 +118,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
COMPENSATION_FOR_RETIRE(107, "0107", "内退一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181936) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -178,13 +148,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
COMPENSATION_FOR_DISMISS(108, "0108", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181937) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -215,13 +178,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
INCOME_FOR_INDIVIDUAL_EQUITY_INCENTIVE(109, "0109", "个人股权激励收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181938) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -252,13 +208,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
ANNUITY_RECEIPT(110, "0110", "年金领取", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181939) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -289,13 +238,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
INCOME_FOR_INSURANCE_SALESMAN(402, "0402", "保险营销员佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181940) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -326,13 +268,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
INCOME_FOR_SECURITIES_BROKER(403, "0403", "证券经纪人佣金收入", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181942) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -363,13 +298,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
REMUNERATION_FOR_OTHER_CONTINUOUS_LABOR(489, "0489", "其他连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181943) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -400,13 +328,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
REMUNERATION_FOR_OTHER_LABOR(499, "0499", "其他非连续劳务报酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 175330) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -437,13 +358,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
REMUNERATION_FOR_AUTHOR(500, "0500", "稿酬所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181944) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -474,12 +388,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
ROYALTIES(600, "0600", "特许权使用费所得", DeclareReportTypeEnum.COMPREHENSIVE_INCOME, 181945) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
@ -511,12 +419,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
NON_RESIDENT_INCOME_WAGES_AND_SALARIES(700, "0700", "无住所个人正常工资薪金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
@ -548,13 +450,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
NON_RESIDENT_INCOME_MONTHLY_BONUS(710, "0710", "无住所个人数月奖金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -585,13 +480,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
},
NON_RESIDENT_INCOME_REMUNERATION_FOR_LABOR(720, "0720", "一般劳务报酬所得", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -621,13 +509,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
}
},
NON_RESIDENT_INCOME_COMPENSATION_FOR_DISMISS(730, "0730", "解除劳动合同一次性补偿金", DeclareReportTypeEnum.NONRESIDENT_INCOME, 181945) {
@Override
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);
}
@Override
public Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO) {
Gson gs = new Gson();
@ -676,9 +557,6 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
this.labelId = labelId;
}
public abstract void parseGetDeclareTaxResultFeedbackResponse(Map<String, List<List<Object>>> result, GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse);
public abstract Map<Long, SalarySobTaxRuleDTO> parseGetASynIndividualIncomeTaxFeedbackResponse(GetASynIndividualIncomeTaxFeedbackResponse declareTaxResultFeedbackResponse, List<EmployeeDeclarePO> employeeDeclares, SalarySobTaxRuleDTO taxRuleDTO);

View File

@ -1,15 +1,7 @@
package com.engine.salary.remote.tax.client;
import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse;
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;
/**
* 个税申报客户端
* <p>Copyright: Copyright (c) 2023</p>
@ -24,22 +16,5 @@ public class DeclareClient extends TaxBaseClient{
super(taxAgentId);
}
/**
* 申报内置算税结果查询
* @param requestId·
* @return
*/
public GetDeclareTaxResultFeedbackResponse getDeclareTaxResultFeedback(String requestId){
// 供应商信息
String url = super.apiConfig.getHost() + "/gateway/iit/report/getDeclareTaxResultFeedback";
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, GetDeclareTaxResultFeedbackResponse.class);
}
}

View File

@ -1,18 +1,15 @@
package com.engine.salary.service;
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationValueListDTO;
import com.engine.salary.entity.taxdeclaration.param.ContrastQueryParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationValueListQueryParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordDetailSaveParam;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO;
import com.engine.salary.util.page.PageInfo;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* 个税申报表明细
@ -89,17 +86,6 @@ public interface TaxDeclarationValueService {
*/
void autoAddWagesDeclare(TaxDeclareRecordPO po);
/**
* 对比
* @param param
*/
Map<String, Object> contrast(ContrastQueryParam param);
/**
* 导出在线对比
*/
XSSFWorkbook exportContrast(ContrastQueryParam param);
/**
* 根据主键删除

View File

@ -2,14 +2,12 @@ package com.engine.salary.service;
import com.engine.salary.common.YearMonthRange;
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO;
import com.engine.salary.entity.taxdeclaration.param.DeclareTaxResultFeedbackQueryParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordParam;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareRecordPO;
import com.engine.salary.util.page.PageInfo;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.util.Collection;
import java.util.Date;
@ -141,16 +139,6 @@ public interface TaxDeclareRecordService {
void getDeclareFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate);
/**
* 申报内置算税结果查询
*
* @param id
* @return
*/
Object getDeclareTaxResultFeedback(Long id);
XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param);
/**
* 作废
*

View File

@ -343,184 +343,6 @@ public class TaxDeclarationValueServiceImpl extends Service implements TaxDeclar
batchSave(autoAddValuePOs);
}
@Override
public Map<String, Object> contrast(ContrastQueryParam param) {
TaxDeclarationPO taxDeclaration = getTaxDeclarationService(user).getById(param.getTaxDeclarationId());
if (taxDeclaration == null) {
throw new SalaryRunTimeException("无申报表");
}
TaxDeclareRecordPO taxDeclareRecordPO = getTaxDeclareRecordMapper().getById(taxDeclaration.getTaxDeclareRecordId());
if (taxDeclareRecordPO == null) {
throw new SalaryRunTimeException("申报记录不存在!");
}
Integer reportType = IncomeCategoryEnum.parseByValue(taxDeclaration.getIncomeCategory()).getReportType().getValue();
TaxDeclareStatusPO taxDeclareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(taxDeclareRecordPO.getId(), reportType);
//线上数据
DeclareClient declareClient = new DeclareClient(taxDeclareRecordPO.getTaxAgentId());
GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareStatus.getDeclareRequestId());
Map<String, List<List<Object>>> onlineDataMap = new HashMap<>();
List<TaxDeclarationPO> list = getTaxDeclarationService(user).listByTaxDeclareRecordId(taxDeclareRecordPO.getId());
list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(onlineDataMap, declareTaxResultFeedbackResponse));
Map<String, Object> resultList = new HashMap<>();
List<TaxDeclarationValuePO> taxDeclarationValues = listByTaxDeclarationId(taxDeclaration.getId());
// 查询个税申报表表头
IncomeCategoryEnum incomeCategoryEnum = SalaryEnumUtil.enumMatchByValue(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.class);
List<TaxReportColumnPO> taxReportColumns = getTaxReportColumnService(user).listByIncomeCategory(incomeCategoryEnum);
List<String> columns = SalaryEntityUtil.properties(taxReportColumns, TaxReportColumnPO::getReportColumnName, Collectors.toList());
// 人员id
Set<Long> employeeIds = SalaryEntityUtil.properties(taxDeclarationValues, TaxDeclarationValuePO::getEmployeeId);
// 查询报送的人员
List<EmployeeDeclarePO> employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentIdAndEmployeeIds(taxDeclaration.getTaxCycle(), taxDeclaration.getTaxAgentId(), employeeIds);
// 查询人员信息
List<Long> simpleEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> taxDeclarationValue.getEmployeeType() == null || Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())).map(TaxDeclarationValuePO::getEmployeeId).distinct().collect(Collectors.toList());
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds);
// 查询人员薪资身份证号码等
List<DataCollectionEmployee> simpleUserInfos = getSalaryEmployeeService(user).getEmployeeByIds(simpleEmployeeIds);
// 查询外部人员
List<Long> extEmployeeIds = taxDeclarationValues.stream().filter(taxDeclarationValue -> Objects.equals(taxDeclarationValue.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())).map(TaxDeclarationValuePO::getEmployeeId).collect(Collectors.toList());
List<ExtEmpPO> extEmployees = getExtEmpService(user).getExtEmpByIds(extEmployeeIds);
// 列表数据
List<Map<String, Object>> localList = TaxDeclarationValueList.buildTableData(incomeCategoryEnum, taxReportColumns, taxDeclarationValues, employeeDeclares, simpleEmployees, simpleUserInfos, extEmployees, true);
Map<String, Map<String, Object>> localMap = new HashMap<>();
for (Map<String, Object> map : localList) {
String no = map.getOrDefault("证件号码", "").toString();
localMap.put(no, map);
}
List<List<Object>> onlineData = onlineDataMap.get(incomeCategoryEnum.getDefaultLabel());
List<Object> heads = onlineData.get(0);
List<List<Object>> data = onlineData.subList(1, onlineData.size());
List<Map<String, Object>> onlineMap = new ArrayList<>();
for (int i = 0; i < data.size(); i++) {
List<Object> row = data.get(i);
Map<String, Object> m = new HashMap<>();
for (int j = 0; j < heads.size(); j++) {
String key = heads.get(j).toString();
m.put(key, row.get(j));
}
onlineMap.add(m);
}
Map<String, Map<String, Object>> onlineNoMap = new HashMap<>();
for (Map<String, Object> map : onlineMap) {
String no = map.getOrDefault("证件号码", "").toString();
onlineNoMap.put(no, map);
}
List<String> onlyShowColumns = new ArrayList<>();
List<Map<String, Object>> oneResultList = new ArrayList<>();
for (Map<String, Object> local : localList) {
AtomicBoolean hasDiff = new AtomicBoolean(false);
Map<String, Object> result = new HashMap<>();
result.put("工号", local.get("工号"));
result.put("姓名", local.get("姓名"));
result.put("证件类型", local.get("证件类型"));
result.put("证件号码", local.get("证件号码"));
String no = local.getOrDefault("证件号码", "").toString();
Map<String, Object> online = onlineNoMap.get(no);
taxReportColumns.stream().map(TaxReportColumnPO::getReportColumnName).forEach(col -> {
ContrastListDTO dto = new ContrastListDTO();
// 系统值
String localValue = Util.null2String(local.get(col));
// 线上值
String onlineValue = Util.null2String(online.get(col));
dto.setLocal(localValue);
dto.setOnline(onlineValue);
if (NumberUtil.isNumber(localValue) && NumberUtil.isNumber(onlineValue)) {
BigDecimal diff = new BigDecimal(localValue).subtract(new BigDecimal(onlineValue));
if (diff.compareTo(new BigDecimal(0)) != 0) {
dto.setDiff(diff);
onlyShowColumns.add(col);
hasDiff.set(true);
}
} else {
if (!Objects.equals(localValue, onlineValue)) {
dto.setDiff(localValue);
onlyShowColumns.add(col);
hasDiff.set(true);
}
}
result.put(col, dto);
});
if (param.isOnlyShowDiffEmp()) {
if (hasDiff.get()) {
oneResultList.add(result);
}
} else {
oneResultList.add(result);
}
}
List<String> finalOnlyShowColumns = onlyShowColumns.stream().distinct().collect(Collectors.toList());
List<String> headerList = new ArrayList<>();
headerList.add("工号");
headerList.add("姓名");
headerList.add("证件类型");
headerList.add("证件号码");
headerList.addAll((param.isOnlyShowDiffItem() ? finalOnlyShowColumns : columns).stream().collect(Collectors.toList()));
resultList.put("columns", headerList);
resultList.put("pageInfo", SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), oneResultList));
// 显示定制列
List<WeaTableColumn> weaColumns = new ArrayList<>();
weaColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "工号"), "工号"));
weaColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "姓名"), "姓名"));
weaColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "证件类型"), "证件类型"));
weaColumns.add(new WeaTableColumn("100px", SalaryI18nUtil.getI18nLabel(0, "证件号码"), "证件号码"));
for (TaxReportColumnPO columnPO : taxReportColumns) {
weaColumns.add(new WeaTableColumn("100px", columnPO.getReportColumnName(), columnPO.getReportColumnName()));
}
SalaryWeaTable<SalaryArchiveListDTO> table = new SalaryWeaTable<SalaryArchiveListDTO>(user, TaxDeclarationValueListDTO.class);
table.setColumns(weaColumns);
WeaResultMsg result = new WeaResultMsg(false);
result.putAll(table.makeDataResult());
result.success();
resultList.put("dataKey", result.getResultMap());
return resultList;
}
@Override
public XSSFWorkbook exportContrast(ContrastQueryParam param) {
param.setPageSize(1000000000);
param.setCurrent(1);
// 获取线下对比结果
Map<String, Object> contrastMap = contrast(param);
List<String> header = ((List<String>) contrastMap.get("columns"));
PageInfo<Map<String, Object>> pageInfo = (PageInfo<Map<String, Object>>)contrastMap.get("pageInfo");
List<Map<String, Object>> list = pageInfo.getList();
List<WeaTableColumn> empInfoColumns = new ArrayList<>();
empInfoColumns.add(new WeaTableColumn("100px", "工号", "jobNum"));
empInfoColumns.add(new WeaTableColumn("100px", "姓名", "username"));
empInfoColumns.add(new WeaTableColumn("100px", "证件类型", "cardType"));
empInfoColumns.add(new WeaTableColumn("100px", "证件号码", "cardNum"));
List<String> empInfoList = empInfoColumns.stream().map(WeaTableColumn::getText).collect(Collectors.toList());
header = header.stream().filter(h -> !empInfoList.contains(h)).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(param.getColumns())) {
List<String> finalHeader = header;
header = param.getColumns().stream().filter(col -> finalHeader.contains(col)).collect(Collectors.toList());
}
return ExcelUtilPlus.genWorkbook4TaxDeclareContrast(empInfoColumns, header, list, "在线对比结果");
}
@Override
public void deleteById(Long deleteId) {
getTaxDeclarationValueMapper().deleteByIds(Collections.singletonList(deleteId));

View File

@ -27,7 +27,10 @@ import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO;
import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
import com.engine.salary.entity.taxdeclaration.bo.*;
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationRateDTO;
import com.engine.salary.entity.taxdeclaration.param.*;
import com.engine.salary.entity.taxdeclaration.param.AbnormalEmployeeListQueryParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam;
import com.engine.salary.entity.taxdeclaration.param.TaxDeclareRecordParam;
import com.engine.salary.entity.taxdeclaration.po.*;
import com.engine.salary.entity.taxdeclaration.response.CancelDeclareFeedbackResponse;
import com.engine.salary.entity.taxdeclaration.response.DeclareTaxFeedbackResponse;
@ -37,21 +40,17 @@ import com.engine.salary.enums.OperateTypeEnum;
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
import com.engine.salary.enums.taxdeclaration.*;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.taxdeclaration.TaxDeclareRecordMapper;
import com.engine.salary.mapper.taxdeclaration.TaxDeclareStatusMapper;
import com.engine.salary.remote.tax.client.DeclareClient;
import com.engine.salary.remote.tax.response.declare.GetDeclareTaxResultFeedbackResponse;
import com.engine.salary.service.*;
import com.engine.salary.service.factory.TaxPaymentServiceFactory;
import com.engine.salary.util.*;
import com.engine.salary.util.db.IdGenerator;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.excel.ExcelUtil;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
import com.engine.salary.util.valid.ValidUtil;
@ -61,7 +60,6 @@ import com.google.common.collect.Sets;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import weaver.general.Util;
import weaver.hrm.User;
@ -994,41 +992,6 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
}
@Override
public Object getDeclareTaxResultFeedback(Long id) {
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
TaxDeclareRecordPO taxDeclareRecord = taxDeclareRequest.getTaxDeclareRecord();
DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId());
GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getDeclareRequestId());
Map<String, List<List<Object>>> map = new HashMap<>();
List<TaxDeclarationPO> list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id);
list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse));
return declareClient.getDeclareTaxResultFeedback(taxDeclareRecord.getDeclareRequestId());
}
@Override
public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) {
Long id = param.getId();
TaxDeclareRecordPO taxDeclareRecord = getById(id);
String requestId = param.getRequestId();
TaxDeclareStatusPO declareStatus = getTaxDeclareStatusService(user).getTaxDeclareStatus(id, param.getReportType());
DeclareClient declareClient = new DeclareClient(taxDeclareRecord.getTaxAgentId());
GetDeclareTaxResultFeedbackResponse declareTaxResultFeedbackResponse = declareClient.getDeclareTaxResultFeedback(StringUtils.isEmpty(requestId) ? declareStatus.getDeclareRequestId() : requestId);
Map<String, List<List<Object>>> map = new HashMap<>();
List<TaxDeclarationPO> list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id);
list.stream()
.map(TaxDeclarationPO::getIncomeCategory)
.map(IncomeCategoryEnum::parseByValue)
.filter(incomeCategoryEnum -> incomeCategoryEnum.getReportType().getValue().equals(param.getReportType()))
.collect(Collectors.toList()).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse));
return ExcelUtil.genWorkbookV2(map);
}
@Override
public void updateDeclare(Long id, Integer reportType) {
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);

View File

@ -248,100 +248,6 @@ public class TaxDeclarationController {
return new ResponseResult<TaxDeclareRecordParam, String>(user).run(getTaxDeclareRecordWrapper(user)::getDeclareFeedback, taxDeclareRecordParam);
}
/**
* 申报内置算税结果查询
*
* @param
* @return
*/
@GET
@Path("/getDeclareTaxResultFeedback")
@Produces(MediaType.APPLICATION_JSON)
public String getDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<Long, Object>(user).run(getTaxDeclareRecordWrapper(user)::getDeclareTaxResultFeedback, id);
}
/**
* 申报内置算税结果
*
* @return
*/
@POST
@Path("/exportGetDeclareTaxResultFeedback")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response exportGetDeclareTaxResultFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeclareTaxResultFeedbackQueryParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportGetDeclareTaxResultFeedback(param);
String fileName = "申报内置算税结果-" + LocalDate.now();
try {
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
StreamingOutput output = outputStream -> {
workbook.write(outputStream);
outputStream.flush();
};
response.setContentType("application/octet-stream");
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
} catch (Exception e) {
log.error("申报内置算税结果导出异常", e);
throw e;
}
}
/**
* 对比算税过程
*
* @param request
* @param response
* @param param
* @return
*/
@POST
@Path("/contrast")
@Produces(MediaType.APPLICATION_JSON)
public String contrast(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<ContrastQueryParam, Map<String, Object>>(user).run(getTaxDeclareRecordWrapper(user)::contrast, param);
}
/**
* 导出在线对比
*
* @return
*/
@POST
@Path("/exportContrast")
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response exportContrast(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ContrastQueryParam param) {
try {
User user = HrmUserVarify.getUser(request, response);
XSSFWorkbook workbook = getTaxDeclareRecordWrapper(user).exportContrast(param);
String fileName = "在线对比结果-" + LocalDate.now();
try {
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
StreamingOutput output = outputStream -> {
workbook.write(outputStream);
outputStream.flush();
};
response.setContentType("application/octet-stream");
return Response.ok(output).header("Content-disposition", "attachment;filename=" + fileName).header("Cache-Control", "no-cache").build();
} catch (Exception e) {
log.error("在线对比结果导出异常", e);
throw e;
}
}
/**
* 作废

View File

@ -509,15 +509,6 @@ public class TaxDeclareRecordWrapper extends Service {
}
public Object getDeclareTaxResultFeedback(Long id) {
return getTaxDeclareRecordService(user).getDeclareTaxResultFeedback(id);
}
public XSSFWorkbook exportGetDeclareTaxResultFeedback(DeclareTaxResultFeedbackQueryParam param) {
return getTaxDeclareRecordService(user).exportGetDeclareTaxResultFeedback(param);
}
/**
* 作废
*/
@ -660,24 +651,6 @@ public class TaxDeclareRecordWrapper extends Service {
return getTaxDeclareRecordService(user).queryCompanyIncomes(taxDeclareRecordParam);
}
/**
* 对比算税结果
*
* @param param
*/
public Map<String, Object> contrast(ContrastQueryParam param) {
return getTaxDeclarationValueService(user).contrast(param);
}
/**
* 导出在线对比
*
* @param param
* @return
*/
public XSSFWorkbook exportContrast(ContrastQueryParam param) {
return getTaxDeclarationValueService(user).exportContrast(param);
}
/**
* 刷新数据