申报功能
This commit is contained in:
parent
5b241cda49
commit
39c536c7b4
|
|
@ -81,24 +81,27 @@ public class EndowmentInsuranceListDTO {
|
|||
@TableTitle(title = "证件号码", dataIndex = "idNo", key = "idNo")
|
||||
private String idNo;
|
||||
|
||||
|
||||
@ExcelProperty(index = 6)
|
||||
@TableTitle(title = "申报扣除月份", dataIndex = "deductionMonth", key = "deductionMonth")
|
||||
private Date deductionMonth;
|
||||
|
||||
@ExcelProperty(index = 7)
|
||||
@TableTitle(title = "税延养老账户编号", dataIndex = "accountNumber", key = "accountNumber")
|
||||
private String accountNumber;
|
||||
|
||||
@ExcelProperty(index = 7)
|
||||
@ExcelProperty(index = 8)
|
||||
@TableTitle(title = "报税校验码", dataIndex = "checkCode", key = "checkCode")
|
||||
private String checkCode;
|
||||
|
||||
@ExcelProperty(index = 8)
|
||||
@ExcelProperty(index = 9)
|
||||
@TableTitle(title = "年度保费", dataIndex = "yearPremium", key = "yearPremium")
|
||||
private String yearPremium;
|
||||
|
||||
@ExcelProperty(index = 9)
|
||||
@ExcelProperty(index = 10)
|
||||
@TableTitle(title = "月度保费", dataIndex = "monthPremium", key = "monthPremium")
|
||||
private String monthPremium;
|
||||
|
||||
@ExcelProperty(index = 10)
|
||||
@ExcelProperty(index = 11)
|
||||
@TableTitle(title = "本期扣除金额", dataIndex = "currentDeduction", key = "currentDeduction")
|
||||
private String currentDeduction;
|
||||
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ public class GrantDonationListDTO {
|
|||
|
||||
@ExcelProperty(index = 9)
|
||||
@TableTitle(title = "捐赠日期", dataIndex = "donateDate", key = "donateDate")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date donateDate;
|
||||
|
||||
@ExcelProperty(index = 10)
|
||||
|
|
|
|||
|
|
@ -90,11 +90,11 @@ public class HealthInsuranceListDTO {
|
|||
|
||||
@ExcelProperty(index = 7)
|
||||
@TableTitle(title = "保单生效日期", dataIndex = "effectiveDate", key = "effectiveDate")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private Date effectiveDate;
|
||||
|
||||
@ExcelProperty(index = 8)
|
||||
@TableTitle(title = "年度保费", dataIndex = "yearPremium", key = "yearPremium")
|
||||
|
||||
private String yearPremium;
|
||||
|
||||
@ExcelProperty(index = 9)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
package com.engine.salary.entity.datacollection.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 其他免税扣除,附表查询列表
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OtherDeductionFreeListQueryParam{
|
||||
|
||||
@DataCheck(require = true, message = "扣缴义务人id为空")
|
||||
private Long taxAgentId;
|
||||
|
||||
@DataCheck(require = true, message = "税款所属期为空")
|
||||
private Date taxCycle;
|
||||
|
||||
}
|
||||
|
|
@ -1,12 +1,15 @@
|
|||
package com.engine.salary.entity.taxdeclaration.bo;
|
||||
|
||||
import com.engine.salary.entity.datacollection.po.*;
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationValuePO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxReportColumnPO;
|
||||
import com.engine.salary.enums.datacollection.TaxFreeTypeEnum;
|
||||
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.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
|
|
@ -14,6 +17,7 @@ import org.apache.commons.collections4.CollectionUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.Util;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -30,7 +34,8 @@ public class TaxDeclarationRequest {
|
|||
public static Map<String, Object> convert2RequestParam(List<TaxReportColumnPO> taxReportColumns,
|
||||
List<TaxDeclarationPO> taxDeclarations,
|
||||
List<TaxDeclarationValuePO> taxDeclarationValues,
|
||||
List<EmployeeDeclarePO> employeeDeclares) {
|
||||
List<EmployeeDeclarePO> employeeDeclares,
|
||||
Map<TaxFreeTypeEnum, Map<String,? extends List>> taxFreeMap) {
|
||||
Map<String, Map<String, Object>> objRequestParam = Maps.newHashMap();
|
||||
Map<String, List<Map<String, Object>>> listRequestParam = Maps.newHashMap();
|
||||
Map<String, List<TaxReportColumnPO>> taxReportColumnMap = SalaryEntityUtil.group2Map(taxReportColumns, TaxReportColumnPO::getIncomeCategory);
|
||||
|
|
@ -127,7 +132,7 @@ public class TaxDeclarationRequest {
|
|||
employeeRequestParams.add(employeeRequestParam);
|
||||
}
|
||||
// 其他免税扣除附表
|
||||
// buildOtherDeductionDetailParams(taxFreeMap, listRequestParam, employeeDeclare, incomeCategoryEnum, employeeRequestParam);
|
||||
buildOtherDeductionDetailParams(taxFreeMap, listRequestParam, employeeDeclare, incomeCategoryEnum, employeeRequestParam);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -137,6 +142,148 @@ public class TaxDeclarationRequest {
|
|||
return requestParam;
|
||||
}
|
||||
|
||||
private static void buildOtherDeductionDetailParams(Map<TaxFreeTypeEnum, Map<String, ? extends List>> taxFreeMap, Map<String, List<Map<String, Object>>> listRequestParam, EmployeeDeclarePO employeeDeclare, IncomeCategoryEnum incomeCategoryEnum, Map<String, Object> employeeRequestParam) {
|
||||
if (new BigDecimal(employeeRequestParam.getOrDefault("mssd", "0").toString()).compareTo(new BigDecimal("0")) > 0) {
|
||||
Map<String, ? extends List> freeIncomeMap = taxFreeMap.get(TaxFreeTypeEnum.FREE_INCOME);
|
||||
List<FreeIncomePO> poList = (List<FreeIncomePO>) freeIncomeMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle()));
|
||||
if (CollectionUtils.isNotEmpty(poList)) {
|
||||
List<Map<String, Object>> paramMaps = new ArrayList<>();
|
||||
for (FreeIncomePO po : poList) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 姓名
|
||||
map.put("xm", employeeDeclare.getEmployeeName());
|
||||
// 证件类型
|
||||
map.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
|
||||
// 证件号码
|
||||
map.put("zzhm", employeeDeclare.getCardNum());
|
||||
// 所得项目
|
||||
map.put("sdxm", incomeCategoryEnum.getDefaultLabel());
|
||||
map.put("jmsx", po.getFreeItem());
|
||||
map.put("jmxz", po.getFreeProperty());
|
||||
map.put("sjkcje", po.getFreeAmount());
|
||||
paramMaps.add(map);
|
||||
}
|
||||
listRequestParam.put("msfblb", paramMaps);
|
||||
}
|
||||
}
|
||||
|
||||
String string = employeeRequestParam.getOrDefault("syjkbx", "0").toString();
|
||||
System.out.println();
|
||||
|
||||
if (new BigDecimal(employeeRequestParam.getOrDefault("syjkbx", "0").toString()).compareTo(new BigDecimal("0")) > 0) {
|
||||
Map<String, ? extends List> healthInsuranceMap = taxFreeMap.get(TaxFreeTypeEnum.HEALTH_INSURANCE);
|
||||
List<HealthInsurancePO> pos = (List<HealthInsurancePO>) healthInsuranceMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle()));
|
||||
if (CollectionUtils.isNotEmpty(pos)) {
|
||||
List<Map<String, Object>> paramMaps = new ArrayList<>();
|
||||
for (HealthInsurancePO healthInsurancePO : pos) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 姓名
|
||||
map.put("xm", employeeDeclare.getEmployeeName());
|
||||
// 证件类型
|
||||
map.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
|
||||
// 证件号码
|
||||
map.put("zzhm", employeeDeclare.getCardNum());
|
||||
// 所得项目
|
||||
map.put("sdxm", incomeCategoryEnum.getDefaultLabel());
|
||||
map.put("bdsxrq",SalaryDateUtil.getFormatLocalDate(healthInsurancePO.getEffectiveDate()) );
|
||||
map.put("sysbm", healthInsurancePO.getIdentificationNumber());
|
||||
map.put("ndbf", healthInsurancePO.getYearPremium());
|
||||
map.put("ydbf", healthInsurancePO.getMonthPremium());
|
||||
map.put("sjkcje", healthInsurancePO.getCurrentDeduction());
|
||||
paramMaps.add(map);
|
||||
}
|
||||
listRequestParam.put("syjkbxfblb", paramMaps);
|
||||
}
|
||||
}
|
||||
if (new BigDecimal(employeeRequestParam.getOrDefault("syylbx", "0").toString()).compareTo(new BigDecimal("0")) > 0) {
|
||||
Map<String, ? extends List> posMap = taxFreeMap.get(TaxFreeTypeEnum.ENDOWMENT_INSURANCE);
|
||||
List<EndowmentInsurancePO> pos = (List<EndowmentInsurancePO>) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle()));
|
||||
if (CollectionUtils.isNotEmpty(pos)) {
|
||||
List<Map<String, Object>> paramMaps = new ArrayList<>();
|
||||
for (EndowmentInsurancePO po : pos) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 姓名
|
||||
map.put("xm", employeeDeclare.getEmployeeName());
|
||||
// 证件类型
|
||||
map.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
|
||||
// 证件号码
|
||||
map.put("zzhm", employeeDeclare.getCardNum());
|
||||
// 所得项目
|
||||
map.put("sdxm", incomeCategoryEnum.getDefaultLabel());
|
||||
map.put("sbkcyf", SalaryDateUtil.getFormatYearMonth((po.getDeductionMonth())));
|
||||
map.put("syylzhbh", po.getAccountNumber());
|
||||
map.put("bsjym", po.getCheckCode());
|
||||
map.put("ndbf", po.getYearPremium());
|
||||
map.put("ydbf", po.getMonthPremium());
|
||||
map.put("sjkcje", po.getCurrentDeduction());
|
||||
paramMaps.add(map);
|
||||
}
|
||||
listRequestParam.put("syjkbxfblb", paramMaps);
|
||||
}
|
||||
}
|
||||
if (new BigDecimal(employeeRequestParam.getOrDefault("zykcjze", "0").toString()).compareTo(new BigDecimal("0")) > 0) {
|
||||
Map<String, ? extends List> posMap = taxFreeMap.get(TaxFreeTypeEnum.GRANT_DONATION);
|
||||
List<GrantDonationPO> pos = (List<GrantDonationPO>) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle()));
|
||||
if (CollectionUtils.isNotEmpty(pos)) {
|
||||
List<Map<String, Object>> paramMaps = new ArrayList<>();
|
||||
for (GrantDonationPO po : pos) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 姓名
|
||||
map.put("xm", employeeDeclare.getEmployeeName());
|
||||
// 证件类型
|
||||
map.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
|
||||
// 证件号码
|
||||
map.put("zzhm", employeeDeclare.getCardNum());
|
||||
// 所得项目
|
||||
map.put("sdxm", incomeCategoryEnum.getDefaultLabel());
|
||||
map.put("szdwmc", po.getRecipientName());
|
||||
map.put("szdwnsrsbh", po.getTaxCode());
|
||||
map.put("jzpzh", po.getDonationNumber());
|
||||
if (po.getDonateDate() != null) {
|
||||
map.put("jzrq", SalaryDateUtil.getFormatLocalDate(po.getDonateDate()));
|
||||
}
|
||||
map.put("jzje", po.getDonateAmount());
|
||||
map.put("kcbl", po.getDeductionProportion());
|
||||
map.put("sjkcje", po.getActualDeduction());
|
||||
paramMaps.add(map);
|
||||
}
|
||||
listRequestParam.put("zykcjzefb", paramMaps);
|
||||
}
|
||||
}
|
||||
|
||||
if (new BigDecimal(employeeRequestParam.getOrDefault("jmse", "0").toString()).compareTo(new BigDecimal("0")) > 0) {
|
||||
Map<String, ? extends List> posMap = taxFreeMap.get(TaxFreeTypeEnum.DERATE_DEDUCTION);
|
||||
List<DerateDeductionPO> pos = (List<DerateDeductionPO>) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle()));
|
||||
if (CollectionUtils.isNotEmpty(pos)) {
|
||||
List<Map<String, Object>> paramMaps = new ArrayList<>();
|
||||
for (DerateDeductionPO po : pos) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 姓名
|
||||
map.put("xm", employeeDeclare.getEmployeeName());
|
||||
// 证件类型
|
||||
map.put("zzlx", CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel());
|
||||
// 证件号码
|
||||
map.put("zzhm", employeeDeclare.getCardNum());
|
||||
// 所得项目
|
||||
map.put("sdxm", incomeCategoryEnum.getDefaultLabel());
|
||||
map.put("jmsx", po.getDerateItem());
|
||||
map.put("jmxz", po.getDerateProperty());
|
||||
map.put("sjkcje", po.getDerateAmount());
|
||||
paramMaps.add(map);
|
||||
}
|
||||
listRequestParam.put("jmfblb", paramMaps);
|
||||
}
|
||||
}
|
||||
|
||||
if (new BigDecimal(employeeRequestParam.getOrDefault("qt", "0").toString()).compareTo(new BigDecimal("0")) > 0) {
|
||||
Map<String, ? extends List> posMap = taxFreeMap.get(TaxFreeTypeEnum.OTHER_DERATE_DEDUCTION);
|
||||
List<OtherDerateDeductionPO> pos = (List<OtherDerateDeductionPO>) posMap.get(employeeDeclare.getTaxAgentId() + "-" + employeeDeclare.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(employeeDeclare.getTaxCycle()));
|
||||
if (CollectionUtils.isNotEmpty(pos)) {
|
||||
employeeRequestParam.put("bz", pos.get(0).getRemark());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Map<String, Object> convert2RequestParam(IncomeCategoryEnum incomeCategoryEnum,
|
||||
List<TaxReportColumnPO> taxReportColumns,
|
||||
TaxDeclarationValuePO taxDeclarationValue,
|
||||
|
|
|
|||
|
|
@ -38,7 +38,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();
|
||||
|
|
@ -52,6 +51,12 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
Gson gs = new Gson();
|
||||
List<SalarySobTaxRuleDTO.TaxRuleDTO> taxRules = taxRuleDTO.getTaxRules();
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.sssbyy> sssbyylb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSssbyylb();
|
||||
if (CollectionUtil.isNotEmpty(sssbyylb)) {
|
||||
String err = sssbyylb.stream().map(yy -> yy.getXm() + "" + yy.getCwxx()).collect(Collectors.joining(";"));
|
||||
throw new OnlineCalculateTaxException(err);
|
||||
}
|
||||
|
||||
List<GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> sscglb = declareTaxResultFeedbackResponse.getBody().getZhsd().getZcgzxj().getSscglb();
|
||||
Map<String, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result> idNoResultMap = SalaryEntityUtil.convert2Map(sscglb, GetASynIndividualIncomeTaxFeedbackResponse.Body.zhsd.ssjgdx.result::getZzhm);
|
||||
Map<Long, SalarySobTaxRuleDTO> resultMap = new HashMap<>();
|
||||
|
|
@ -526,6 +531,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
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) {
|
||||
checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse);
|
||||
|
|
@ -637,6 +643,7 @@ public enum IncomeCategoryEnum implements BaseEnum<Integer> {
|
|||
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) {
|
||||
checkGetASynIndividualIncomeTaxFeedbackResponse(declareTaxResultFeedbackResponse);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.engine.salary.service;
|
|||
|
||||
import com.engine.salary.entity.datacollection.dto.*;
|
||||
import com.engine.salary.entity.datacollection.param.*;
|
||||
import com.engine.salary.entity.datacollection.po.OtherDeductionPO;
|
||||
import com.engine.salary.entity.datacollection.po.*;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
||||
|
|
@ -132,6 +132,14 @@ public interface OtherDeductionService {
|
|||
PageInfo<OtherDerateDeductionListDTO> otherDerateDeductionList(OtherDeductionDetailQueryParam param);
|
||||
PageInfo<PersonalPensionListDTO> personalPensionList(OtherDeductionDetailQueryParam param);
|
||||
|
||||
List<FreeIncomePO> queryFreeIncomes(OtherDeductionFreeListQueryParam param);
|
||||
List<DerateDeductionPO> queryDerateDeductions(OtherDeductionFreeListQueryParam param);
|
||||
List<EndowmentInsurancePO> queryEndowmentInsurances(OtherDeductionFreeListQueryParam param);
|
||||
List<GrantDonationPO> queryGrantDonations(OtherDeductionFreeListQueryParam param);
|
||||
List<HealthInsurancePO> queryHealthInsurances(OtherDeductionFreeListQueryParam param);
|
||||
List<OtherDerateDeductionPO> queryOtherDerateDeductions(OtherDeductionFreeListQueryParam param);
|
||||
List<PersonalPensionPO> queryPersonalPensions(OtherDeductionFreeListQueryParam param);
|
||||
|
||||
void saveFreeIncome(FreeIncomeSaveParam param);
|
||||
void saveEndowmentInsurance(EndowmentInsuranceSaveParam param);
|
||||
void saveGrantDonation(GrantDonationSaveParam param);
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ import com.engine.salary.util.excel.ExcelSupport;
|
|||
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;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
|
@ -760,7 +761,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
// 错误excel内容
|
||||
List<Map> errorData = new ArrayList<>();
|
||||
|
||||
List<EndowmentInsuranceListDTO> derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 11, "OtherDeductionTemplate.xlsx");
|
||||
List<EndowmentInsuranceListDTO> derateDeductionList = ExcelParseHelper.parse2Map(fileInputStream, EndowmentInsuranceListDTO.class, 2, 1, 12, "OtherDeductionTemplate.xlsx");
|
||||
for (int i = 0; i < derateDeductionList.size(); i++) {
|
||||
EndowmentInsuranceListDTO dto = derateDeductionList.get(i);
|
||||
|
||||
|
|
@ -1508,7 +1509,7 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
|
||||
//清除旧数据
|
||||
OtherDeductionPO otherDeductionPO = getOtherDeductionMapper().getByTaxAgentIdAndEmployeeId(po.getTaxAgentId(), po.getEmployeeId());
|
||||
if(otherDeductionPO != null){
|
||||
if (otherDeductionPO != null) {
|
||||
getOtherDeductionMapper().delete(otherDeductionPO);
|
||||
getFreeIncomeMapper().deleteByMainId(otherDeductionPO.getId());
|
||||
getHealthInsuranceMapper().deleteByMainId(otherDeductionPO.getId());
|
||||
|
|
@ -2413,6 +2414,48 @@ public class OtherDeductionServiceImpl extends Service implements OtherDeduction
|
|||
return SalaryPageUtil.buildPage(param.getCurrent(), param.getPageSize(), listDTOS, PersonalPensionListDTO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FreeIncomePO> queryFreeIncomes(OtherDeductionFreeListQueryParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
return getFreeIncomeMapper().listSome(FreeIncomePO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DerateDeductionPO> queryDerateDeductions(OtherDeductionFreeListQueryParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
return getDerateDeductionMapper().listSome(DerateDeductionPO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<EndowmentInsurancePO> queryEndowmentInsurances(OtherDeductionFreeListQueryParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
return getEndowmentInsuranceMapper().listSome(EndowmentInsurancePO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GrantDonationPO> queryGrantDonations(OtherDeductionFreeListQueryParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
return getGrantDonationMapper().listSome(GrantDonationPO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HealthInsurancePO> queryHealthInsurances(OtherDeductionFreeListQueryParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
return getHealthInsuranceMapper().listSome(HealthInsurancePO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OtherDerateDeductionPO> queryOtherDerateDeductions(OtherDeductionFreeListQueryParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
return getOtherDerateDeductionMapper().listSome(OtherDerateDeductionPO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PersonalPensionPO> queryPersonalPensions(OtherDeductionFreeListQueryParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
return getPersonalPensionMapper().listSome(PersonalPensionPO.builder().taxYearMonth(param.getTaxCycle()).taxAgentId(param.getTaxAgentId()).build());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void saveFreeIncome(FreeIncomeSaveParam param) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import com.engine.salary.config.SalaryElogConfig;
|
|||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.constant.SzyhApiConstant;
|
||||
import com.engine.salary.entity.datacollection.AddUpSituation;
|
||||
import com.engine.salary.entity.datacollection.param.OtherDeductionFreeListQueryParam;
|
||||
import com.engine.salary.entity.datacollection.po.*;
|
||||
import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest;
|
||||
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryAcctEmployeeQueryParam;
|
||||
|
|
@ -34,6 +36,7 @@ import com.engine.salary.entity.taxdeclaration.response.DeclareTaxFeedbackRespon
|
|||
import com.engine.salary.entity.taxdeclaration.response.DeclareTaxResponse;
|
||||
import com.engine.salary.entity.taxdeclaration.response.UpdateDeclareResponse;
|
||||
import com.engine.salary.enums.OperateTypeEnum;
|
||||
import com.engine.salary.enums.datacollection.TaxFreeTypeEnum;
|
||||
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
|
||||
import com.engine.salary.enums.salaryaccounting.SalaryAcctRecordStatusEnum;
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
|
|
@ -172,6 +175,10 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
return ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private OtherDeductionService getOtherDeductionService(User user) {
|
||||
return ServiceUtil.getService(OtherDeductionServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private TaxPaymentServiceFactory taxPaymentServiceFactory = new TaxPaymentServiceFactory(user);
|
||||
|
||||
|
|
@ -680,6 +687,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
List<EmployeeDeclarePO> employeeDeclares = getEmployeeDeclareService(user).listByTaxCycleAndTaxAgentId(taxDeclareRecord.getTaxCycle(), taxDeclareRecord.getTaxAgentId());
|
||||
employeeDeclares = employeeDeclares.stream().filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())).collect(Collectors.toList());
|
||||
|
||||
// 查询其他免税扣除明细
|
||||
Map<TaxFreeTypeEnum, Map<String, ? extends List>> taxFreeMap = getOtherDeductionDetailMap(taxDeclareRecord);
|
||||
|
||||
TaxDeclarationApiConfigPO apiConfig = taxDeclareRequest.getTaxDeclarationApiConfig();
|
||||
// 查询个税申报表的表头
|
||||
List<TaxReportColumnPO> taxReportColumns = getTaxReportColumnService(user).listAll();
|
||||
|
|
@ -693,7 +703,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
|
||||
if (declareReportType == DeclareReportTypeEnum.COMPREHENSIVE_INCOME) {
|
||||
// 综合所得
|
||||
Map<String, Object> taxDeclarationParam = TaxDeclarationRequest.convert2RequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares);
|
||||
Map<String, Object> taxDeclarationParam = TaxDeclarationRequest.convert2RequestParam(taxReportColumns, taxDeclarations, taxDeclarationValues, employeeDeclares, taxFreeMap);
|
||||
requestParam.put("zhsd", taxDeclarationParam);
|
||||
}
|
||||
|
||||
|
|
@ -740,6 +750,36 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
private Map<TaxFreeTypeEnum, Map<String, ? extends List>> getOtherDeductionDetailMap(TaxDeclareRecordPO taxDeclareRecord) {
|
||||
Map<TaxFreeTypeEnum, Map<String, ? extends List>> taxFreeMap = new HashMap<>();
|
||||
OtherDeductionFreeListQueryParam queryParam = OtherDeductionFreeListQueryParam.builder().taxAgentId(taxDeclareRecord.getTaxAgentId()).taxCycle(taxDeclareRecord.getTaxCycle()).build();
|
||||
|
||||
List<FreeIncomePO> freeIncomes = getOtherDeductionService(user).queryFreeIncomes(queryParam);
|
||||
Map<String, List<FreeIncomePO>> freeIncomeMap = freeIncomes.stream().collect(Collectors.groupingBy(e -> e.getTaxAgentId() + "-" + e.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())));
|
||||
taxFreeMap.put(TaxFreeTypeEnum.FREE_INCOME, freeIncomeMap);
|
||||
|
||||
List<HealthInsurancePO> healthInsurances = getOtherDeductionService(user).queryHealthInsurances(queryParam);
|
||||
Map<String, List<HealthInsurancePO>> healthInsuranceMap = healthInsurances.stream().collect(Collectors.groupingBy(e -> e.getTaxAgentId() + "-" + e.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())));
|
||||
taxFreeMap.put(TaxFreeTypeEnum.HEALTH_INSURANCE, healthInsuranceMap);
|
||||
|
||||
List<EndowmentInsurancePO> endowmentInsurances = getOtherDeductionService(user).queryEndowmentInsurances(queryParam);
|
||||
Map<String, List<EndowmentInsurancePO>> endowmentInsuranceMap = endowmentInsurances.stream().collect(Collectors.groupingBy(e -> e.getTaxAgentId() + "-" + e.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())));
|
||||
taxFreeMap.put(TaxFreeTypeEnum.ENDOWMENT_INSURANCE, endowmentInsuranceMap);
|
||||
|
||||
List<GrantDonationPO> grantDonations = getOtherDeductionService(user).queryGrantDonations(queryParam);
|
||||
Map<String, List<GrantDonationPO>> grantDonationMap = grantDonations.stream().collect(Collectors.groupingBy(e -> e.getTaxAgentId() + "-" + e.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())));
|
||||
taxFreeMap.put(TaxFreeTypeEnum.GRANT_DONATION, grantDonationMap);
|
||||
|
||||
List<DerateDeductionPO> derateDeductions = getOtherDeductionService(user).queryDerateDeductions(queryParam);
|
||||
Map<String, List<DerateDeductionPO>> derateDeductionMap = derateDeductions.stream().collect(Collectors.groupingBy(e -> e.getTaxAgentId() + "-" + e.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())));
|
||||
taxFreeMap.put(TaxFreeTypeEnum.DERATE_DEDUCTION, derateDeductionMap);
|
||||
|
||||
List<OtherDerateDeductionPO> otherDerateDeductions = getOtherDeductionService(user).queryOtherDerateDeductions(queryParam);
|
||||
Map<String, List<OtherDerateDeductionPO>> otherDerateDeductionMap = otherDerateDeductions.stream().collect(Collectors.groupingBy(e -> e.getTaxAgentId() + "-" + e.getEmployeeId() + "-" + SalaryDateUtil.getFormatYearMonth(e.getTaxYearMonth())));
|
||||
taxFreeMap.put(TaxFreeTypeEnum.OTHER_DERATE_DEDUCTION, otherDerateDeductionMap);
|
||||
return taxFreeMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDeclareFeedback(Long id, Integer reportType, TaxDeclarationRateDTO taxDeclarationRate) {
|
||||
TaxDeclareRequest taxDeclareRequest = buildTaxDeclareRequest(id);
|
||||
|
|
@ -902,9 +942,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
requestParam.put("sfqksd", "0");
|
||||
|
||||
Map<String, String> responseParam = new HashMap<>();
|
||||
responseParam.put("reportType",reportType + "");
|
||||
responseParam.put("reportType", reportType + "");
|
||||
DeclareClient declareClient = new DeclareClient(taxAgentId);
|
||||
CancelDeclareFeedbackResponse cancelDeclareFeedbackResponse = declareClient.cancel(requestParam,responseParam);
|
||||
CancelDeclareFeedbackResponse cancelDeclareFeedbackResponse = declareClient.cancel(requestParam, responseParam);
|
||||
|
||||
// 作废是否成功
|
||||
CancelDeclareStatusEnum cancelDeclareStatusEnum = SalaryEnumUtil.enumMatchByValue(SalaryEntityUtil.getIntValue(cancelDeclareFeedbackResponse.getBody().get("fkztbj"), 10), CancelDeclareStatusEnum.class);
|
||||
|
|
|
|||
Loading…
Reference in New Issue